-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize setuptools packaging and automate releases
- Loading branch information
Showing
15 changed files
with
244 additions
and
174 deletions.
There are no files selected for viewing
This file contains 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 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 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,117 @@ | ||
name: Publish testbook | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/testbook | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
github-release: | ||
name: >- | ||
Sign the Python 🐍 distribution 📦 with Sigstore | ||
and upload them to GitHub Release | ||
needs: | ||
- publish-to-pypi | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "" | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
# Upload to GitHub Release using the `gh` CLI. | ||
# `dist/` contains the built packages, and the | ||
# sigstore-produced signatures and certificates. | ||
run: >- | ||
gh release upload | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' | ||
publish-to-testpypi: | ||
name: Publish Python 🐍 distribution 📦 to TestPyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/testbook | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
This file contains 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 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 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,29 +1,132 @@ | ||
# Example configuration for Black. | ||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
|
||
# NOTE: you have to use single-quoted strings in TOML for regular expressions. | ||
# It's the equivalent of r-strings in Python. Multiline strings are treated as | ||
# verbose regular expressions by Black. Use [ ] to denote a significant space | ||
# character. | ||
requires = [ "setuptools" ] | ||
|
||
[project] | ||
name = "testbook_rohitsanjay" | ||
version = "0.4.2" | ||
description = "A unit testing framework for Jupyter Notebooks" | ||
readme = "README.md" | ||
keywords = [ "jupyter", "notebook", "nteract", "unit-testing" ] | ||
license = { file = "LICENSE" } | ||
maintainers = [ | ||
{ name = "Nteract Contributors", email = "[email protected]" }, | ||
{ name = "Rohit Sanjay", email = "[email protected]" }, | ||
{ name = "Matthew Seal", email = "[email protected]" }, | ||
] | ||
authors = [ | ||
{ name = "Nteract Contributors", email = "[email protected]" }, | ||
{ name = "Rohit Sanjay", email = "[email protected]" }, | ||
{ name = "Matthew Seal", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.6" | ||
|
||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Software Development :: Testing", | ||
"Topic :: Software Development :: Testing :: Mocking", | ||
"Topic :: Software Development :: Testing :: Unit", | ||
] | ||
dependencies = [ | ||
"nbclient>=0.4", | ||
"nbformat>=5.0.4", | ||
] | ||
optional-dependencies.dev = [ | ||
"black; python_version>='3.6'", | ||
"bumpversion", | ||
"check-manifest", | ||
"codecov", | ||
"coverage", | ||
"flake8", | ||
"ipykernel", | ||
"ipython", | ||
"ipywidgets", | ||
"pandas", | ||
"pip>=18.1", | ||
"pytest>=4.1", | ||
"pytest-cov>=2.6.1", | ||
"setuptools>=38.6", | ||
"tox", | ||
"build", | ||
"twine>=1.11", | ||
"xmltodict", | ||
] | ||
optional-dependencies.test = [ | ||
"myst-parser==0.9.1", | ||
"sphinx>=1.7,<3", | ||
"sphinx-book-theme==0.0.35", | ||
] | ||
urls.Documentation = "https://testbook.readthedocs.io" | ||
urls.Funding = "https://nteract.io" | ||
urls.Issues = "https://github.com/nteract/testbook/issues" | ||
urls.Repository = "https://github.com/nteract/testbook/" | ||
|
||
[tool.black] | ||
line-length = 100 | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
/( | ||
\.git | ||
| \.hg | ||
| \.mypy_cache | ||
| \.tox | ||
| \.venv | ||
| _build | ||
| buck-out | ||
| build | ||
| dist | ||
# The following are specific to Black, you probably don't want those. | ||
| blib2to3 | ||
| tests/data | ||
| profiling | ||
)/ | ||
''' | ||
skip-string-normalization = true | ||
|
||
[tool.flake8] | ||
exclude = "__init__.py" | ||
ignore = [ | ||
"E20", # Extra space in brackets | ||
"E231", | ||
"E241", # Multiple spaces around "," | ||
"E26", # Comments | ||
"E4", # Import formatting | ||
"E721", # Comparing types instead of isinstance | ||
"E731", # Assigning lambda expression | ||
] | ||
max-line-length = 120 | ||
|
||
# Not sure I need this? | ||
# [tool.bdist_wheel] | ||
# universal = 0 | ||
|
||
[tool.pytest.ini_options] | ||
filterwarnings = "always" | ||
testpaths = [ | ||
"testbook/tests/", | ||
] | ||
|
||
[tool.coverage.run] | ||
branch = false | ||
omit = [ | ||
"testbook/tests/*", | ||
"testbook/_version.py", | ||
] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"if self\\.debug:", | ||
"pragma: no cover", | ||
"raise AssertionError", | ||
"raise NotImplementedError", | ||
"if __name__ == '__main__':", | ||
] | ||
ignore_errors = true | ||
omit = [ | ||
"testbook/tests/*", | ||
"testbook/_version.py", | ||
] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.