-
Notifications
You must be signed in to change notification settings - Fork 84
build: Modernize codejail to use uv and pyproject.toml #328
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0b38ff8
chore: modernize codejail to use uv and pyproject.toml
farhan a92ef81
chore: update Dockerfile to use uv for dependency management
farhan efce90f
fix: add numpy to test-base dependency group
farhan e6bdf44
fix: resolve __version__ dynamically via importlib.metadata
farhan 8a46de8
chore: install Docker venvs from dependency groups
farhan 7de502c
build: run quality inside Docker to keep ci.yml in parity with master
farhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ on: | |
| branches: | ||
| - master | ||
| pull_request: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| codejail_ci: | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| run_ci: | ||
| uses: ./.github/workflows/ci.yml | ||
|
|
||
| release: | ||
| needs: run_ci | ||
| runs-on: ubuntu-latest | ||
| if: github.ref_name == 'master' | ||
| concurrency: | ||
| group: ${{ github.workflow }}-release-${{ github.ref_name }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
|
|
||
| - name: Force branch to workflow sha | ||
| run: git reset --hard ${{ github.sha }} | ||
|
|
||
| - name: Run 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: "actions@users.noreply.github.com" | ||
| vcs_release: "false" | ||
|
|
||
| - name: 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 distribution artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| if: steps.release.outputs.released == 'true' | ||
| with: | ||
| name: distribution-artifacts | ||
| path: dist | ||
| if-no-files-found: error | ||
|
|
||
| outputs: | ||
| released: ${{ steps.release.outputs.released || 'false' }} | ||
| version: ${{ steps.release.outputs.version }} | ||
|
|
||
| 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 build artifacts | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: distribution-artifacts | ||
| path: dist | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| include LICENSE.txt | ||
| include README.rst | ||
| include requirements/* | ||
| # Exclude development, test, and documentation folders | ||
| prune .github | ||
| prune docs | ||
|
|
||
| # Exclude root level configuration and build files | ||
| exclude Makefile | ||
| exclude conftest.py | ||
| exclude .gitignore | ||
| exclude tox.ini | ||
|
|
||
| # Include operational files needed by the package | ||
| include apparmor-profiles/* | ||
| include sudoers-file/* | ||
| include requirements/constraints.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| [build-system] | ||
| requires = ["setuptools", "setuptools-scm>8.1"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "edx-codejail" | ||
| description = "CodeJail manages execution of untrusted code in secure sandboxes. It is designed primarily for Python execution, but can be used for other languages as well." | ||
| requires-python = ">=3.12" | ||
| license = "Apache-2.0" | ||
| license-files = ["LICENSE*"] | ||
| authors = [ | ||
| {name = "Open edX Project", email = "oscm@openedx.org"}, | ||
| ] | ||
| classifiers = [ | ||
| "Development Status :: 5 - Production/Stable", | ||
| "Operating System :: POSIX :: Linux", | ||
| "Intended Audience :: Developers", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.12", | ||
| ] | ||
| keywords = [ | ||
| "Python", | ||
| "edx", | ||
| "codejail", | ||
| ] | ||
|
|
||
| dynamic = ["readme", "version"] | ||
|
|
||
| dependencies = [ | ||
| "six", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/openedx/codejail" | ||
| Repository = "https://github.com/openedx/codejail" | ||
|
|
||
| [dependency-groups] | ||
| sandbox = [ | ||
| "numpy", | ||
| "six", | ||
| ] | ||
| test-base = [ | ||
| {include-group = "sandbox"}, | ||
| "pylint", | ||
| "pytest", | ||
| "isort", | ||
| "pycodestyle", | ||
| ] | ||
| test = [ | ||
| {include-group = "test-base"}, | ||
| "Django>=5.2,<6.0", | ||
| ] | ||
| django42 = [ | ||
| {include-group = "test-base"}, | ||
| "Django>=4.2,<5.0", | ||
| ] | ||
| quality = [ | ||
| {include-group = "test"}, | ||
| "edx-lint", | ||
| ] | ||
| ci = [ | ||
| "tox", | ||
| "tox-uv", | ||
| ] | ||
| dev = [ | ||
| {include-group = "quality"}, | ||
| {include-group = "ci"}, | ||
| ] | ||
|
|
||
| [tool.setuptools] | ||
| include-package-data = true | ||
| script-files = ["memory_stress.py"] | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| readme = {file = ["README.rst"], content-type = "text/x-rst"} | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] | ||
|
|
||
| [tool.setuptools.package-data] | ||
| "*" = [ | ||
| "tests/hello.txt", | ||
| ] | ||
|
|
||
| [tool.semantic_release] | ||
| build_command = "pip install build && SETUPTOOLS_SCM_PRETEND_VERSION=$NEW_VERSION python -m build" | ||
|
|
||
| [tool.setuptools_scm] | ||
| version_scheme = 'only-version' | ||
| local_scheme = 'no-local-version' | ||
| fallback_version = "0.0.0.dev0" | ||
|
|
||
| [tool.uv] | ||
| package = true | ||
| conflicts = [ | ||
| [{group = "django42"}, {group = "test"}], | ||
| [{group = "django42"}, {group = "quality"}], | ||
| [{group = "dev"}, {group = "django42"}], | ||
| ] | ||
| constraint-dependencies = [ | ||
| "Django<6.0", | ||
| "elasticsearch<7.14.0", | ||
| "social-auth-app-django<6.0.0", | ||
| "social-auth-core<5.0.0", | ||
| "pip<26.2.1", | ||
| ] | ||
|
|
||
| [tool.edx_lint] | ||
| uv_constraints = [] | ||
|
|
||
| [tool.coverage.run] | ||
| branch = true | ||
| source = ["codejail"] | ||
| omit = [ | ||
| "*/tests/doit.py", | ||
| ] | ||
|
|
||
| [tool.coverage.report] | ||
| show_missing = true | ||
|
|
||
| [tool.isort] | ||
| include_trailing_comma = true | ||
| indent = " " | ||
| line_length = 120 | ||
| multi_line_output = 3 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ah, we forgot to set
changelog: falseso the release failed.