-
Notifications
You must be signed in to change notification settings - Fork 23
feat: modernize to uv + pyproject.toml + python-semantic-release #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
61dfda2
aa7ed88
6c9f41d
a36fa63
8b8ae3a
2bac59f
314afe1
1ac306b
e0edee6
3766508
3aceddb
8ca1061
f218295
b262bd8
b5139fc
683ae7c
2eb9b0b
b38d412
56b079f
8ba716b
a3df501
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| run_tests: | ||
| uses: ./.github/workflows/ci.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
|
|
||
| release: | ||
| runs-on: ubuntu-latest | ||
| needs: run_tests | ||
| if: github.ref_name == 'master' | ||
| concurrency: | ||
| group: ${{ github.workflow }}-release-${{ github.ref_name }} | ||
| cancel-in-progress: false | ||
| permissions: | ||
| contents: write | ||
| outputs: | ||
| released: ${{ steps.release.outputs.released || 'false' }} | ||
| version: ${{ steps.release.outputs.version }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
|
|
||
| - run: git reset --hard ${{ github.sha }} | ||
|
|
||
| - name: Python Semantic Release | ||
| id: release | ||
| uses: python-semantic-release/python-semantic-release@9a026e9303981c866c3425723009becb2437c757 # v10.6.2 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| git_committer_name: "github-actions" | ||
| git_committer_email: "github-actions@github.com" | ||
| changelog: "false" | ||
| # Commit, tag, push and build, but don't create the GitHub release. | ||
| # We create it ourselves in the next step so that the distributions | ||
| # are attached before the release is published. See that step for why. | ||
| vcs_release: "false" | ||
|
|
||
| # This repo has immutable releases enabled, which freezes a release's | ||
| # assets the moment it is published, so assets cannot be attached | ||
| # afterwards. `gh release create` handles this by creating the release as | ||
| # a draft, uploading the assets, and only then publishing it: | ||
| # https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/immutable-releases | ||
| - name: Publish | Create GitHub Release with Assets | ||
| if: steps.release.outputs.released == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RELEASE_NOTES: ${{ steps.release.outputs.release_notes }} | ||
| TAG: ${{ steps.release.outputs.tag }} | ||
| run: | | ||
| printf '%s' "$RELEASE_NOTES" > "$RUNNER_TEMP/release_notes.md" | ||
| gh release create "$TAG" \ | ||
| --verify-tag \ | ||
| --title "$TAG" \ | ||
| --notes-file "$RUNNER_TEMP/release_notes.md" \ | ||
| dist/* | ||
|
|
||
| - name: Upload dist artifacts | ||
| if: steps.release.outputs.released == 'true' | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| if-no-files-found: error | ||
|
|
||
| publish_to_pypi: | ||
| runs-on: ubuntu-latest | ||
| needs: release | ||
| if: github.ref_name == 'master' && needs.release.outputs.released == 'true' | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Download dist artifacts | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| include *.rst LICENSE.txt AUTHORS | ||
| include requirements/base.in | ||
| include requirements/constraints.txt | ||
| recursive-include src/auth_backends *.html *.png *.gif *js *.css *jpg *jpeg *svg *py |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=64", "setuptools-scm>=8.0"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "edx-auth-backends" | ||
| description = "Custom edX authentication backends and pipeline steps" | ||
| readme = "README.rst" | ||
| license = "AGPL-3.0" | ||
| license-files = ["LICENSE.txt"] | ||
| requires-python = ">=3.12" | ||
| authors = [ | ||
| {name = "Open edX Project", email = "oscm@openedx.org"}, | ||
| ] | ||
| keywords = ["authentication", "edx"] | ||
| classifiers = [ | ||
| "Development Status :: 5 - Production/Stable", | ||
| "Environment :: Web Environment", | ||
| "Intended Audience :: Developers", | ||
| "Operating System :: OS Independent", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Framework :: Django", | ||
| "Framework :: Django :: 5.2", | ||
| "Topic :: Internet", | ||
| ] | ||
| dynamic = ["version"] | ||
| dependencies = [ | ||
| "django>=5.2,<6.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5.0.0 published
|
||
| "edx-django-utils", | ||
| "edx-toggles", | ||
| "pyjwt[crypto]>=2.1.0", | ||
| "six", | ||
| "social-auth-app-django", | ||
| "social-auth-core", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/openedx/auth-backends" | ||
|
|
||
| [dependency-groups] | ||
| # Base test packages, no version pins - let uv.lock handle it | ||
| test-base = [ | ||
| "coverage", | ||
| "ddt", | ||
| "edx-django-release-util", | ||
| "httpretty", | ||
| "pycryptodomex", | ||
| "pytest-cov", | ||
| "pytest-django", | ||
| "responses", | ||
| "typing_extensions", | ||
| "unittest2", | ||
| ] | ||
| test = [ | ||
| {include-group = "test-base"}, | ||
| "django>=5.2,<5.3", | ||
| ] | ||
| quality = [ | ||
| {include-group = "test"}, | ||
| "edx-lint", | ||
| "pycodestyle", | ||
| "pylint", | ||
| ] | ||
| # Minimal CI group: just what's needed to invoke tox | ||
| ci = [ | ||
| "tox", | ||
| "tox-uv", | ||
| ] | ||
| dev = [ | ||
| {include-group = "quality"}, | ||
| {include-group = "ci"}, | ||
| ] | ||
|
|
||
| [tool.setuptools_scm] | ||
| version_scheme = "only-version" | ||
| local_scheme = "no-local-version" | ||
| fallback_version = "0.0.0" | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] | ||
| include = ["auth_backends"] | ||
|
|
||
| [tool.setuptools.exclude-package-data] | ||
| "*" = ["tests*", "*.tests*", "spec*", "*.spec*"] | ||
|
|
||
| [tool.uv] | ||
| package = true | ||
|
|
||
| # DO NOT EDIT constraint-dependencies DIRECTLY. | ||
| # This list is managed by `edx_lint write_uv_constraints` | ||
| # and will be overwritten the next time `make upgrade` is run. | ||
| # - GLOBAL constraints: edit edx_lint/files/common_constraints.txt | ||
| # - REPO-SPECIFIC constraints: edit [tool.edx_lint].uv_constraints in this file | ||
| constraint-dependencies = [ | ||
| "Django<6.0", | ||
| "elasticsearch<7.14.0", | ||
| ] | ||
|
|
||
| [tool.edx_lint] | ||
| uv_constraints = [] | ||
|
|
||
| [tool.semantic_release] | ||
| build_command = "python -m pip install --upgrade build && SETUPTOOLS_SCM_PRETEND_VERSION=$NEW_VERSION python -m build" | ||
| major_on_zero = false | ||
| allow_zero_version = true | ||
| tag_format = "v{version}" | ||
|
|
||
| [tool.coverage.run] | ||
| branch = true | ||
| source = ["src/auth_backends"] | ||
| omit = [ | ||
| "*/tests/*", | ||
| "*/migrations/*", | ||
| "*/__pycache__/*", | ||
| "*/settings.py", | ||
| ] | ||
|
|
||
| [tool.coverage.report] | ||
| show_missing = true | ||
| exclude_lines = [ | ||
| "pragma: no cover", | ||
| "raise NotImplementedError", | ||
| "if __name__ == .__main__.:", | ||
| ] | ||
|
|
||
| [tool.coverage.html] | ||
| directory = "htmlcov" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| [pytest] | ||
| DJANGO_SETTINGS_MODULE=test_settings | ||
| addopts = --cov auth_backends --cov-report term-missing --cov-report xml | ||
| testpaths = auth_backends/tests | ||
| testpaths = src/auth_backends/tests |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AGPL-3.0is deprecated in SPDX.setup.py:130publishedLicense :: OSI Approved :: GNU Affero General Public License v3with no "or later", so useAGPL-3.0-onlyhere.