Skip to content

Commit

Permalink
use Flit as build system
Browse files Browse the repository at this point in the history
This patch switches the build system from setuptools (using `setup.py`) to Flit
(using `pyproject.toml`).
  • Loading branch information
joostvanzwieten committed Nov 30, 2022
1 parent 708b0e2 commit 163ea93
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: python3 -m pip install setuptools wheel
run: python3 -m pip install flit
- name: Build package
run: python3 setup.py sdist bdist_wheel
run: python3 -m flit build
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install build dependencies
run: python3 -m pip install setuptools wheel
run: python3 -m pip install flit
- name: Build package
id: build
run: |
# To make the wheels reproducible, set the timestamp of the (files in
# the) generated wheels to the date of the commit.
export SOURCE_DATE_EPOCH=`git show -s --format=%ct`
python3 setup.py sdist bdist_wheel
python3 -m flit build
printf "::set-output name=wheel::%s" dist/*.whl
- name: Upload package artifacts
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
python3 -um pip install setuptools wheel
python3 -um pip install --upgrade --upgrade-strategy eager .[docs]
- name: Build docs
run: python3 setup.py build_sphinx --nitpicky --warning-is-error --keep-going
run: python3 -m sphinx -n -W --keep-going docs build/sphinx/html
build-and-test-container-image:
name: Build container image
needs: build-python-package
Expand Down
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[project]
name = "nutils"
readme = "README.md"
authors = [
{ name = "Evalf", email = "[email protected]" },
]
requires-python = '~=3.7'
dependencies = [
"appdirs~=1.0",
"bottombar~=2.0.2",
"numpy>=1.17",
"psutil~=5.0",
"stringly",
"treelog>=1.0b5",
]
dynamic = ["description", "version"]

[project.optional-dependencies]
docs = ["Sphinx>=1.8"]
export_mpl = ["matplotlib>=1.3", "pillow>2.6"]
matrix_mkl = ["mkl"]
matrix_scipy = ["scipy>=0.13"]
import_gmsh = ["meshio"]

[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
50 changes: 0 additions & 50 deletions setup.py

This file was deleted.

0 comments on commit 163ea93

Please sign in to comment.