-
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
base: master
Are you sure you want to change the base?
Changes from all commits
f0ad6da
eb6a9c7
4dd760c
21d5c47
a6f42e9
2ed3161
600a60a
6bad88d
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,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@v4 | ||
|
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.
|
||
| 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@v4 | ||
|
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.
|
||
| with: | ||
| 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 |
|---|---|---|
| @@ -1,8 +1,4 @@ | ||
| include AUTHORS | ||
| include CHANGELOG.rst | ||
| include LICENSE.txt | ||
| include LICENSE.TXT | ||
| include README.rst | ||
| include requirements/base.in | ||
| include requirements/test.in | ||
| include requirements/test.txt | ||
| include requirements/constraints.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=64", "setuptools-scm>=8.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. We had a discussion on it. |
||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "xblock-sdk" | ||
| dynamic = ["version"] | ||
| description = "XBlock SDK" | ||
| readme = "README.rst" | ||
| license = "AGPL-3.0" | ||
| license-files = ["LICENSE.TXT"] | ||
| classifiers = [ | ||
| "Development Status :: 3 - Alpha", | ||
| "Framework :: Django", | ||
| "Framework :: Django :: 4.2", | ||
| "Framework :: Django :: 5.2", | ||
| "Intended Audience :: Developers", | ||
| "Natural Language :: English", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.12", | ||
| ] | ||
| requires-python = ">=3.12" | ||
| dependencies = [ | ||
| "cookiecutter", | ||
| "django>=4.2", | ||
| "fs-s3fs", | ||
| "lxml", | ||
| "requests", | ||
| "pypng", | ||
| "simplejson", | ||
| "web-fragments", | ||
| "webob", | ||
| "XBlock[django]", | ||
| ] | ||
|
|
||
| [project.entry-points."xblock.v1"] | ||
| helloworld_demo = "sample_xblocks.basic.content:HelloWorldBlock" | ||
| allscopes_demo = "sample_xblocks.basic.content:AllScopesBlock" | ||
| html_demo = "sample_xblocks.basic.content:HtmlBlock" | ||
| sequence_demo = "sample_xblocks.basic.structure:Sequence" | ||
| vertical_demo = "sample_xblocks.basic.structure:VerticalBlock" | ||
| sidebar_demo = "sample_xblocks.basic.structure:SidebarBlock" | ||
| problem_demo = "sample_xblocks.basic.problem:ProblemBlock" | ||
| textinput_demo = "sample_xblocks.basic.problem:TextInputBlock" | ||
| equality_demo = "sample_xblocks.basic.problem:EqualityCheckerBlock" | ||
| attempts_scoreboard_demo = "sample_xblocks.basic.problem:AttemptsScoreboardBlock" | ||
| slider_demo = "sample_xblocks.basic.slider:Slider" | ||
| view_counter_demo = "sample_xblocks.basic.view_counter:ViewCounter" | ||
| thumbs = "sample_xblocks.thumbs:ThumbsBlock" | ||
| filethumbs = "sample_xblocks.filethumbs:FileThumbsBlock" | ||
| debugchild = "workbench.blocks:DebuggingChildBlock" | ||
|
|
||
| [tool.setuptools_scm] | ||
| version_scheme = "only-version" | ||
| local_scheme = "no-local-version" | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] | ||
|
|
||
| [tool.setuptools.package-data] | ||
| "sample_xblocks.basic" = ["public/**/*", "templates/**/*"] | ||
| "sample_xblocks.thumbs" = ["static/**/*"] | ||
| "sample_xblocks.filethumbs" = ["static/**/*"] | ||
| "workbench" = ["static/**/*", "templates/**/*", "test/**/*"] | ||
|
|
||
| [tool.setuptools.exclude-package-data] | ||
| "*" = ["tests*", "*.tests*", "spec*", "*.spec*"] | ||
|
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. The pattern "*" = ["test*", "tests*", "*.test*", "*.tests*", "spec*", "*.spec*"] |
||
|
|
||
| [tool.coverage.run] | ||
| branch = true | ||
| source = ["."] | ||
|
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. After the source_pkgs = ["workbench", "sample_xblocks"]This ensures |
||
| omit = [ | ||
| "workbench/test/*", | ||
|
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. The omit = [
"src/workbench/test/*",
"src/sample_xblocks/*/test/*",
"*/migrations/*",
"*/__pycache__/*",
"*/settings.py",
] |
||
| "sample_xblocks/*/test/*", | ||
| "*/migrations/*", | ||
| "*/__pycache__/*", | ||
| "*/settings.py", | ||
| ] | ||
|
|
||
| [tool.coverage.report] | ||
| show_missing = true | ||
| exclude_lines = [ | ||
| "pragma: no cover", | ||
| "def __repr__", | ||
| "raise AssertionError", | ||
| "raise NotImplementedError", | ||
| "if __name__ == .__main__.:", | ||
| "if TYPE_CHECKING:", | ||
| ] | ||
|
|
||
| [tool.coverage.html] | ||
| directory = "htmlcov" | ||
|
|
||
| [dependency-groups] | ||
| # To update the matrix: run `uv lock --upgrade` and add/remove Django version groups as needed. | ||
| test-base = [ | ||
| "acid-xblock", | ||
| "coverage", | ||
| "ddt", | ||
| "mock", | ||
| "pytest", | ||
| "pytest-cov", | ||
| "pytest-django", | ||
| "pytest-rerunfailures", | ||
| ] | ||
| test = [ | ||
| { include-group = "test-base" }, | ||
| "django>=5.2,<6.0", | ||
| ] | ||
| django42 = [ | ||
| "django>=4.2,<5.0", | ||
| ] | ||
| quality = [ | ||
| { include-group = "test" }, | ||
| "edx-lint", | ||
| "isort", | ||
| "pycodestyle", | ||
| "pydocstyle", | ||
| ] | ||
| doc = [ | ||
| { include-group = "test" }, | ||
| "sphinx", | ||
| "sphinxcontrib-napoleon", | ||
| ] | ||
| ci = [ | ||
| "tox", | ||
| "tox-uv", | ||
| ] | ||
| dev = [ | ||
| { include-group = "quality" }, | ||
| { include-group = "ci" }, | ||
| { include-group = "doc" }, | ||
| ] | ||
|
|
||
| [tool.uv] | ||
| package = true | ||
| # test includes Django>=5.2 and django42 includes Django>=4.2,<5.0 — they conflict. | ||
| conflicts = [ | ||
| [ | ||
| { group = "test" }, | ||
| { group = "django42" }, | ||
| ], | ||
| ] | ||
| constraint-dependencies = [ | ||
| "Django<6.0", | ||
| "elasticsearch<7.14.0", | ||
| "setuptools<82.0", | ||
| ] | ||
|
|
||
| [tool.edx_lint] | ||
| uv_constraints = [ | ||
| # setuptools 82 removed pkg_resources; pyfilesystem2 (fs) still uses it | ||
| # https://setuptools.pypa.io/en/latest/history.html#v82-0-0 | ||
| "setuptools<82.0", | ||
| ] | ||
|
|
||
| [tool.semantic_release] | ||
| version_toml = [] | ||
| build_command = "python -m pip install --upgrade build && SETUPTOOLS_SCM_PRETEND_VERSION=$NEW_VERSION python -m build" | ||
| allow_zero_version = true | ||
| major_on_zero = false | ||
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.
The
push: branches: [master]trigger was removed.Is this intentional?