Skip to content

Commit

Permalink
Add pyproject.toml and explicit build requirements (#109)
Browse files Browse the repository at this point in the history
Add pyproject.toml with build-system information.
This information explicitly states to install jupyter_core (as well as
setuptools).

Update publish workflow.

Completely avoid running setup.py directly. This is deprecated.
  • Loading branch information
CasperWA authored Sep 6, 2023
1 parent 259ce29 commit 6b34411
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
python -m pip install --upgrade pip
pip install -U setuptools wheel
pip install -U build
pip install -r requirements_base.txt
- name: Build package with build
run: python -m build --sdist --wheel --outdir dist/

- name: Build package with setup.py
run: python setup.py sdist bdist_wheel
run: python -m build
12 changes: 6 additions & 6 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.8"

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools
pip install -U setuptools wheel build
pip install -U invoke
- name: Update version
Expand All @@ -49,10 +49,10 @@ jobs:
branch: develop

- name: Build source distribution
run: python ./setup.py sdist
run: python -m build

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=42.0.0", "jupyter_core>=5.3.1,<6"]
build-backend = "setuptools.build_meta"

0 comments on commit 6b34411

Please sign in to comment.