-
Notifications
You must be signed in to change notification settings - Fork 24
Modernize python tooling #282
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
8f33384
0992e7f
8b8899f
781330e
de1b784
57a5f1c
ba46de2
bcbc889
6500702
195182b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| run_tests: | ||
| name: ${{ matrix.toxenv }} | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| strategy: | ||
| matrix: | ||
| toxenv: [py312-django42, py312-django52, quality] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | ||
| with: | ||
| python-version: "3.12" | ||
| enable-cache: true | ||
|
|
||
| - name: Install CI dependencies | ||
| run: uv sync --group ci | ||
|
|
||
| - name: Run tox | ||
| run: uv run tox -e ${{ matrix.toxenv }} |
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: "false" | ||
|
|
||
| - name: Upload dist artifacts | ||
| if: steps.release.outputs.released == 'true' | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
|
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.
Resolve the current SHA: Then use:
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. Fixed |
||
| 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: | ||
|
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.
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. Fixed |
||
| name: dist | ||
| path: dist/ | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,30 +10,19 @@ clean: ## delete generated byte code and coverage reports | |
| rm -rf assets | ||
| rm -rf pii_report | ||
|
|
||
| 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 -q -r requirements/pip_tools.txt | ||
| pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip_tools.txt requirements/pip_tools.in | ||
| pip install -qr requirements/pip_tools.txt | ||
| pip-compile --upgrade -o requirements/base.txt requirements/base.in | ||
| pip-compile --upgrade -o requirements/test.txt requirements/test.in | ||
| upgrade: ## update uv.lock with the latest packages satisfying pyproject.toml constraints | ||
| uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml | ||
| uv lock --upgrade | ||
|
|
||
| requirements: ## install development environment requirements | ||
| pip install -q -r requirements/pip_tools.txt | ||
| pip install -qr requirements/base.txt --exists-action w | ||
| pip-sync requirements/base.txt requirements/constraints.txt requirements/test.txt | ||
| uv sync --group dev | ||
|
|
||
| quality-python: ## Run python linters | ||
| pylint --rcfile=pylintrc acid setup.py | ||
| uv run pylint --rcfile=pylintrc src/acid | ||
|
|
||
|
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.
After the Consider:
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. Fixed |
||
| quality: quality-python ## Run linters | ||
|
|
||
| test-python: clean ## run tests using pytest and generate coverage report | ||
| pytest | ||
| uv run pytest | ||
|
|
||
| test: test-python ## run tests | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| coverage: | ||
| status: | ||
| project: | ||
| default: | ||
| enabled: yes | ||
| target: auto | ||
| patch: | ||
| default: | ||
| enabled: yes | ||
| target: 100% | ||
|
|
||
| comment: false |
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.
ci.ymldoes not exist on this branch or onmaster.We ought to add ci to run the tests.
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.
Fixed