From 906f1689dd485e4689c00608569b0ccea7b5e2ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 14:02:13 +0000 Subject: [PATCH 1/5] Initial plan From 18d865fbb7af58a1561e28dfc77f17955eb1953d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 14:11:44 +0000 Subject: [PATCH 2/5] Fix PyPI source distribution filename to comply with PEP 625 Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com> --- .github/workflows/push.yml | 6 +++--- pyproject.toml | 4 ++++ setup.py | 6 ++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index cd65d28..f4f0013 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -55,11 +55,11 @@ jobs: cache: pip cache-dependency-path: setup.py - - name: ๐Ÿ›ž Install wheel - run: pip install wheel + - name: ๐Ÿ›ž Install build + run: pip install build - name: ๐Ÿ“ฆ Build package - run: python setup.py sdist bdist_wheel + run: python -m build - name: ๐Ÿš€ Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index bf3e305..b76ac26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools>=45", "wheel"] +build-backend = "setuptools.build_meta" + [tool.ruff] line-length = 120 ignore = ["E501"] diff --git a/setup.py b/setup.py index 637d5dc..afef907 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import find_packages, setup setup( - name="ugrc-swapper", + name="ugrc_swapper", version="1.2.3", license="MIT", description="Move data from one SDE database to another with minimal downtime", @@ -51,8 +51,6 @@ "ruff==0.*", ] }, - setup_requires=[ - "pytest-runner", - ], + setup_requires=[], entry_points={"console_scripts": ["swapper = swapper.__main__:main"]}, ) From ceb27b51609a138b093e81d22bd34613d203c0ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 14:36:18 +0000 Subject: [PATCH 3/5] Initial plan for addressing feedback Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com> --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index afef907..637d5dc 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import find_packages, setup setup( - name="ugrc_swapper", + name="ugrc-swapper", version="1.2.3", license="MIT", description="Move data from one SDE database to another with minimal downtime", @@ -51,6 +51,8 @@ "ruff==0.*", ] }, - setup_requires=[], + setup_requires=[ + "pytest-runner", + ], entry_points={"console_scripts": ["swapper = swapper.__main__:main"]}, ) From e11ed6204f31a29dce39c9f5ecd9a033a8e2ca00 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 14:39:17 +0000 Subject: [PATCH 4/5] Revert setup.py name change and update workflows to match sweeper project Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com> --- .github/workflows/pull_request.yml | 42 ++++++++++++++++++ .github/workflows/push.yml | 35 --------------- .github/workflows/release.yml | 68 ++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/pull_request.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..d96bd64 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,42 @@ +name: Pull Request Events + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + test-unit: + name: Unit tests + runs-on: ubuntu-latest + + steps: + - name: โฌ‡๏ธ Set up code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: ๐Ÿ Set up Python + uses: actions/setup-python@v5 + with: + cache: pip + cache-dependency-path: setup.py + + - name: ๐Ÿ— Install module + run: pip install .[tests] + + - name: ๐Ÿงถ Lint + run: ruff check --output-format=github . + + - name: ๐Ÿงช Run tests + run: pytest + + - name: โฌ†๏ธ Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./cov.xml \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f4f0013..f8eb43f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - dev concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -17,8 +16,6 @@ jobs: permissions: contents: write pull-requests: write - outputs: - release_created: ${{ steps.release-please.outputs.release_created }} steps: - name: ๐Ÿš€ Create Release @@ -26,40 +23,8 @@ jobs: uses: agrc/release-composite-action@v1 with: release-type: python - prerelease: ${{ github.ref_name == 'dev' }} repo-token: ${{ secrets.GITHUB_TOKEN }} github-app-id: ${{ secrets.UGRC_RELEASE_BOT_APP_ID }} github-app-key: ${{ secrets.UGRC_RELEASE_BOT_APP_KEY }} github-app-name: ${{ secrets.UGRC_RELEASE_BOT_NAME }} github-app-email: ${{ secrets.UGRC_RELEASE_BOT_EMAIL }} - - deploy-prod: - runs-on: ubuntu-latest - needs: release-please - if: github.ref == 'refs/heads/main' && needs.release-please.outputs.release_created - environment: - name: prod - url: https://pypi.org/project/ugrc-swapper/ - permissions: - id-token: write - - steps: - - name: โฌ‡๏ธ Set up code - uses: actions/checkout@v4 - with: - show-progress: false - - - name: ๐Ÿ Set up Python - uses: actions/setup-python@v5 - with: - cache: pip - cache-dependency-path: setup.py - - - name: ๐Ÿ›ž Install build - run: pip install build - - - name: ๐Ÿ“ฆ Build package - run: python -m build - - - name: ๐Ÿš€ Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..18c4139 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release Events +on: + release: + types: [published] + +env: + GH_TOKEN: ${{ github.token }} + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: โฌ‡๏ธ Set up code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: ๐Ÿ Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: .python-version + cache: pip + cache-dependency-path: setup.py + + - name: ๐Ÿ“ฆ Build package + run: pipx run build + + - name: โฌ†๏ธ Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: dist + retention-days: 1 + + publish: + name: Publish + runs-on: ubuntu-latest + needs: build + environment: + name: prod + url: https://pypi.org/project/ugrc-swapper + permissions: + id-token: write + + steps: + - name: โฌ‡๏ธ Download artifacts + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: dist + + - name: ๐Ÿš€ Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + notify: + name: Notifications + runs-on: ubuntu-latest + needs: publish + permissions: + contents: read + pull-requests: write + issues: write + steps: + - name: Release Notifier + uses: agrc/release-issue-notifications-action@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 5540639fca12a29987cac0f436993d591034e351 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 14:53:03 +0000 Subject: [PATCH 5/5] Remove unnecessary build-backend to match sweeper project Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com> --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b76ac26..913bb5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,5 @@ [build-system] -requires = ["setuptools>=45", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["setuptools >= 70.2"] [tool.ruff] line-length = 120