Commit a2f756fe authored by Sean Leavey's avatar Sean Leavey
Browse files

Make Finesse build PEP 517 compatible

Fix build

Fix build

Fix build

Fix build

Add back conda build, update numpy dep

Fix build

Fix build

Fix build

Fix build

Fix build

Fix build
parent 16af6a65
......@@ -81,6 +81,23 @@ build/manylinux/3.9:
# paths:
# - wheelhouse
# Check the project builds with Conda on Linux, since it's a common way to develop
# Finesse (currently no tests get run).
build/linux/conda:
stage: build
image: igwn/base:conda
script:
- apt update
- apt install -y build-essential
# Create the environment using the definition file and store it locally so we can
# pass it to other jobs.
- conda env create -f environment.yml -p .finesse-env
- source activate ./.finesse-env # Needs to be "source", not "conda".
- python --version
# Simply check it can be imported.
- python -c "import finesse"
# A build with special flags set on Cython extensions to enable debugging.
build/debug:
stage: build
......@@ -91,10 +108,8 @@ build/debug:
- apt install -y libsuitesparse-dev
# Install editable mode so in-place pyx files are picked up by coverage.
- pip3 install -e .[dev]
# Build Cython extensions with coverage support.
- python3 setup.py --coverage build_ext --force --inplace
# Make a platform-specific wheel.
- python3 setup.py bdist_wheel -d wheelhouse
# Make a platform-specific wheel (with Cython coverage support)
- pip3 wheel . --no-deps -w wheelhouse --build-option --coverage --debug
artifacts:
paths:
- wheelhouse
......@@ -110,7 +125,7 @@ test/debian/3.8:
image: python:3.8
script:
- pip3 install -r requirements-test.txt
- pip3 install wheelhouse/finesse-*-cp38-cp38-*.manylinux2014_x86_64.whl
- pip3 install -f wheelhouse finesse
- pytest tests
test/debian/3.9:
......@@ -120,7 +135,7 @@ test/debian/3.9:
image: python:3.9
script:
- pip3 install -r requirements-test.txt
- pip3 install wheelhouse/finesse-*-cp39-cp39-*.manylinux2014_x86_64.whl
- pip3 install -f wheelhouse finesse
- pytest tests
# test/macosx/3.8:
......@@ -138,7 +153,7 @@ test/debian/3.9:
# - conda activate ./.finesse-env
# - python --version
# - pip install -r requirements-test.txt
# - pip install wheelhouse/finesse-*-cp38-cp38-macosx_10_9_x86_64.whl
# - pip install -f wheelhouse finesse
# - pytest tests
# test/macosx/3.9:
......@@ -156,7 +171,7 @@ test/debian/3.9:
# - conda activate ./.finesse-env
# - python --version
# - pip install -r requirements-test.txt
# - pip install wheelhouse/finesse-*-cp39-cp39-macosx_10_9_x86_64.whl
# - pip install -f wheelhouse finesse
# - pytest tests
# Test coverage report generation. The report is used to show coverage details in merge
......@@ -174,9 +189,9 @@ test/coverage:
# Dependencies for running the tests. Cython is also required from the build
# dependencies for use by the pytest Cython coverage plugin.
- pip3 install -r requirements-test.txt
- pip3 install wheelhouse/finesse-*-cp39-cp39-linux_x86_64.whl
- pip3 install -f wheelhouse finesse
# Run all tests and generate Cobertura XML formatted coverage report.
- pytest --cov=finesse --cov-config=setup.cfg --cov-report=xml tests
- pytest --cov=finesse --cov-config=pyproject.toml --cov-report=xml tests
# Generate human readable coverage report.
- pycobertura show coverage.xml # Necessary so the GitLab CI regex picks up the total.
coverage: '/^TOTAL\s+.*\s+(\d+\.?\d*)%/' # Regex to allow GitLab to extract and display coverage.
......@@ -197,7 +212,7 @@ docs/html:
script:
- pip install -r requirements-doc.txt
# Sphinx autodoc needs to be able to import finesse and finesse_sphinx.
- pip install wheelhouse/finesse-*-cp39-cp39-*.manylinux2014_x86_64.whl
- pip install -f wheelhouse finesse
- cd docs
# Build HTML docs in single process mode. Can go back to "make html" when the
# EOFError is fixed in Sphinx. See #270.
......@@ -229,7 +244,7 @@ docs/pdf:
- apt install -y texlive-latex-base librsvg2-bin xindy
- pip install -r requirements-doc.txt
# Sphinx autodoc needs to be able to import finesse and finesse_sphinx.
- pip install wheelhouse/finesse-*-cp39-cp39-*.manylinux2014_x86_64.whl
- pip install -f wheelhouse finesse
- cd docs
- make latexpdf
- cd ..
......
[build-system]
requires = ["setuptools", "wheel", "Cython>=0.29", "numpy >= 1.11"]
requires = ["setuptools", "setuptools_scm", "wheel", "Cython>=0.29", "numpy >= 1.20.0"]
build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
......
# Requirements for building documentation
### NOTE See https://finesse.docs.ligo.org/finesse3/developer/codeguide/requirements.html
# Requirements for building documentation.
# See https://finesse.docs.ligo.org/finesse3/developer/codeguide/requirements.html.
sphinx
sphinx_rtd_theme
......
# Requirements for running tests
### NOTE See https://finesse.docs.ligo.org/finesse3/developer/codeguide/requirements.html
# Requirements for test runners.
# See https://finesse.docs.ligo.org/finesse3/developer/codeguide/requirements.html.
pytest
pytest-cov
......
### NOTE See https://finesse.docs.ligo.org/finesse3/developer/codeguide/requirements.html
numpy >= 1.20.0 # 1.19 causes a segfault, 1.20 is not available on conda so we must specify it here, see #306
scipy >= 1.4.0
matplotlib >= 3.0.0
networkx >= 2.4
sly == 0.4
h5py >= 2.10.0
click >= 7.1.0
click-default-group >= 1.2.2
tabulate >= 0.8.7
control >= 0.9.0
sympy >= 1.6.0
......@@ -224,54 +224,6 @@ def ext_modules():
)
# Dependencies for runtime, setup/build and optional extras.
# NOTE: these should not pin versions unless there are incompatibilities with the latest
# releases, in which case leave a comment as to why (see
# https://finesse.readthedocs.io/en/latest/developer/codeguide/requirements.html).
REQUIREMENTS = [
"numpy",
"scipy",
"matplotlib",
"sympy",
"networkx",
"sly",
"h5py",
"click",
"click-default-group",
"tabulate",
]
EXTRA_REQUIREMENTS = {
"dev": [
# Documentation.
"sphinx",
"sphinx_rtd_theme",
"sphinxcontrib-bibtex",
"sphinxcontrib-katex",
"sphinxcontrib-svg2pdfconverter",
"sphinxcontrib-programoutput",
"jupyter-sphinx",
"numpydoc",
"reslate",
# Testing.
"pytest",
"pytest-cov",
# Can't use latest coverage version due to Cython bug as of 2020-11-26
# (https://github.com/cython/cython/issues/3515).
"coverage == 4.5.4",
"Faker",
"hypothesis",
"pycobertura",
# Linting.
"black",
"pre-commit",
"pylint",
"flake8",
"flake8-bugbear",
"doc8",
],
"graphviz": ["pygraphviz",],
}
CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"Topic :: Scientific/Engineering :: Physics",
......@@ -317,10 +269,57 @@ if __name__ == "__main__":
"usr.ini.dist", # Barebone user config file.
]
},
# Requirements. See pyproject.toml for build system requirements.
# Requirements. See pyproject.toml for build system requirements and
# https://finesse.docs.ligo.org/finesse3/developer/codeguide/requirements.html
# for more information.
python_requires=">=3.8",
install_requires=REQUIREMENTS,
extras_require=EXTRA_REQUIREMENTS,
install_requires=[
# Pin these to specific packages so updates don't break Finesse in the wild.
# Periodically update these to newer versions where possible.
"numpy==1.20.3",
"scipy==1.6.3",
"matplotlib==3.4.2",
"networkx==2.5.1",
"sly==0.4",
"click==8.0.1",
"click-default-group==1.2.2",
"tabulate==0.8.9",
"control==0.9.0",
"sympy==1.8.0",
],
extras_require={
# Development extras. These should not be pinned to specific versions so
# that we can continuously test the latest versions. One exception would be
# for when there are incompatibilities with new versions, in which case
# pin to a working version and leave a comment as to why.
"dev": [
# Testing.
"pytest",
"pytest-cov",
"coverage == 4.5.4", # Cython incompatibility with newer versions: https://github.com/cython/cython/issues/3515
"Faker",
"hypothesis",
"pycobertura",
# Documentation.
"sphinx",
"sphinx_rtd_theme",
"sphinxcontrib-bibtex",
"sphinxcontrib-katex",
"sphinxcontrib-svg2pdfconverter",
"sphinxcontrib-programoutput",
"jupyter-sphinx",
"numpydoc",
"reslate",
# Linting.
"black",
"pre-commit",
"pylint",
"flake8",
"flake8-bugbear",
"doc8",
],
"graphviz": ["pygraphviz"],
},
# Other.
license="GPL",
classifiers=CLASSIFIERS,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment