-
Notifications
You must be signed in to change notification settings - Fork 104
Modernize python tooling #519
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: Semantic Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| run_tests: | ||
| uses: ./.github/workflows/ci.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
|
|
||
| release: | ||
| needs: run_tests | ||
| if: github.ref_name == 'master' | ||
| runs-on: ubuntu-latest | ||
| concurrency: | ||
| group: ${{ github.workflow }}-release | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
|
|
||
| - name: Reset to triggered commit | ||
| run: git reset --hard ${{ github.sha }} | ||
|
|
||
| - name: Python Semantic Release | ||
| id: release | ||
| uses: python-semantic-release/python-semantic-release@350c48fcb3ffcdfd2e0a235206bc2ecea6b69df0 # v10.5.3 | ||
| with: | ||
| git_committer_name: "github-actions[bot]" | ||
| git_committer_email: "github-actions[bot]@users.noreply.github.com" | ||
| changelog: "true" | ||
|
|
||
| - name: Upload dist artifacts | ||
| if: steps.release.outputs.released == 'true' | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| outputs: | ||
| released: ${{ steps.release.outputs.released }} | ||
| version: ${{ steps.release.outputs.version }} | ||
|
|
||
| publish_to_pypi: | ||
| needs: release | ||
| if: needs.release.outputs.released == 'true' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Download dist artifacts | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | ||
| 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 | ||
|---|---|---|---|---|
|
|
@@ -44,52 +44,30 @@ clean: ## remove generated byte code, coverage reports, and build artifacts | |||
| rm -f .coverage | ||||
|
|
||||
| coverage: clean ## generate and view HTML coverage report | ||||
| pip install -qr requirements/local.txt --exists-action w ## Install sample xblocks | ||||
| pytest --cov-report html | ||||
| $(BROWSER) htmlcov/index.html | ||||
|
|
||||
| COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt | ||||
| .PHONY: $(COMMON_CONSTRAINTS_TXT) | ||||
| $(COMMON_CONSTRAINTS_TXT): | ||||
| wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)" | ||||
|
|
||||
| upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade | ||||
| upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in | ||||
| pip install -qr requirements/pip-tools.txt | ||||
| pip install -qr requirements/pip.txt | ||||
| # Make sure to compile files after any other files they include! | ||||
| pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in | ||||
| pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in | ||||
| pip install -qr requirements/pip.txt | ||||
| pip install -qr requirements/pip-tools.txt | ||||
| pip-compile --rebuild --upgrade -o requirements/base.txt requirements/base.in | ||||
| pip-compile --rebuild --upgrade -o requirements/test.txt requirements/test.in | ||||
| pip-compile --rebuild --upgrade -o requirements/quality.txt requirements/quality.in | ||||
| pip-compile --rebuild --upgrade -o requirements/ci.txt requirements/ci.in | ||||
| pip-compile --rebuild --upgrade -o requirements/dev.txt requirements/test.in requirements/quality.in | ||||
| # Let tox control the Django version for tests | ||||
| sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp | ||||
| mv requirements/test.tmp requirements/test.txt | ||||
| upgrade: ## update uv.lock and regenerate uv constraint-dependencies | ||||
| uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml | ||||
| uv lock --upgrade | ||||
|
|
||||
| quality: ## check coding style with pycodestyle and pylint | ||||
| tox -e quality | ||||
| uv run tox -e quality | ||||
|
|
||||
| requirements: ## install development environment requirements | ||||
| pip install -qr requirements/dev.txt --exists-action w | ||||
| pip install -qr requirements/local.txt --exists-action w | ||||
| uv sync --group dev | ||||
|
|
||||
| install: requirements | ||||
|
|
||||
| test: clean ## run tests in the current virtualenv | ||||
| pip install -qr requirements/local.txt --exists-action w ## Install sample xblocks | ||||
|
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. local dependency group is missing in the pyproject.toml 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. Confirmed intentional on the dependency-group side: the old But the Makefile line itself (now at line 47, shifted since your comment) is a live bug, not just a stale reference:
Suggested change
(deletes just that one
Contributor
Author
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. The local group is intentionally absent. The old requirements/local.txt only contained -e . (install the package in editable mode), which is now |
||||
| pytest | ||||
| uv run pytest | ||||
|
|
||||
| diff_cover: test | ||||
| diff-cover coverage.xml | ||||
|
|
||||
| test-all: ## run tests on every supported Python/Django combination | ||||
| tox -e quality | ||||
| tox | ||||
| uv run tox -e quality | ||||
| uv run tox | ||||
|
|
||||
| validate: quality test ## run tests and quality checks | ||||
|
|
||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.