Skip to content
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

migrate setuptools pep621 config to pyproject.toml #4382

Merged
merged 7 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/pytest-min-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: generate min_requirements.txt
# Use fork of requirements-builder until official version
# has support for pyproject.toml (pep621)
run: |
pip install requirements-builder
pip install git+https://github.com/jenshnielsen/requirements-builder.git
jenshnielsen marked this conversation as resolved.
Show resolved Hide resolved
pip install versioningit
requirements-builder -l min -e test setup.py -o min_requirements.txt
- name: install min_requirements.txt
Expand Down
4 changes: 4 additions & 0 deletions docs/changes/newsfragments/4382.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The standard metadata as defined by pep621 has moved from setup.cfg
to pyproject.toml. This should have no user facing consequences unless
you install qcodes from source using a very old version of pip (<19)
or use unusual pip configurations.
87 changes: 86 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,96 @@
[build-system]
requires = [
"setuptools >= 56.0",
"setuptools >= 61.0",
"wheel >= 0.29.0",
"versioningit ~= 1.1.0",
]
build-backend = 'setuptools.build_meta'

[project]
name = "qcodes"
maintainers = [{name = "QCoDeS Core Developers", email = "[email protected]"}]
description = "Python-based data acquisition framework developed by the Copenhagen / Delft / Sydney / Microsoft quantum computing consortium"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering",
]
license = {text = "MIT"}
requires-python = ">=3.7"
dependencies = [
"numpy>=1.17.0",
"pyvisa>=1.11.0, <1.12.0",
"h5py>=3.0.0",
"websockets>=7.0",
"jsonschema>=3.0.0",
"ruamel.yaml>=0.16.0,!=0.16.6",
"wrapt>=1.10.4",
"pandas>=1.0.0",
"xarray>=0.18.0",
"tabulate>=0.8.0",
"tqdm>=4.32.2",
"opencensus>=0.7.10",
"opencensus-ext-azure>=1.0.4, <2.0.0",
"matplotlib>=3.3.0",
"importlib-metadata>=3.6.0,<5.0.0; python_version < '3.10'",
"importlib-resources>=2.0.0; python_version < '3.9'",
"typing_extensions>=3.10.0",
"packaging>=20.0",
"ipywidgets>=7.5.0,<8.0.0",
"broadbean>=0.9.1",
"uncertainties>=3.1.4",
"h5netcdf>=0.10.0,!=0.14.0",
# see https://github.com/h5netcdf/h5netcdf/issues/154
"versioningit>=1.1.0",
# transitive dependencies. We list these explicitly to",
# ensure that we always use versions that do not have",
# known security vulnerabilities",
"ipython>=7.31.1,!=8.0.0",
"pillow>=9.0.0",
"rsa>=4.7",
]

dynamic = ["version"]

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[project.urls]
Homepage = "https://github.com/QCoDeS/Qcodes"
Documentation = "https://qcodes.github.io/Qcodes/"
Source = "https://github.com/qcodes/qcodes"
Tracker = "https://github.com/QCoDeS/Qcodes/issues"
Changelog = "https://qcodes.github.io/Qcodes/changes/index.html"

[project.optional-dependencies]
qtplot = ["pyqtgraph>=0.11.0"]
slack = ["slack-sdk>=3.4.2"]
zurichinstruments = ["zhinst-qcodes>=0.3"]
test = [
"pytest>=6.0.0",
"PyVisa-sim>=0.4.0",
"hypothesis>=5.49.0",
"pytest-xdist>=2.0.0",
"deepdiff>=5.0.2",
"pytest-mock>=3.0.0",
"pytest-rerunfailures>=5.0.0",
"lxml>=4.3.0",
"types_requests>=0.1.8",
"types-setuptools>=57.0.0",
"types-tabulate>=0.1.0",
"Sphinx>=4.1.2",
]

[project.scripts]
qcodes-monitor = "qcodes.monitor.monitor:main"

[tool.coverage.run]
omit = [
"qcodes/__init__.py",
Expand Down
80 changes: 3 additions & 77 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,63 +1,10 @@
[metadata]
name = qcodes
jenshnielsen marked this conversation as resolved.
Show resolved Hide resolved
maintainer = QCoDeS Core Developers
maintainer_email = [email protected]
description = Python-based data acquisition framework developed by the Copenhagen / Delft / Sydney / Microsoft quantum computing consortium
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://github.com/QCoDeS/Qcodes
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering
license = MIT
project_urls =
Documentation = https://qcodes.github.io/Qcodes/
Source = https://github.com/qcodes/qcodes
Tracker = https://github.com/QCoDeS/Qcodes/issues
Changelog = https://qcodes.github.io/Qcodes/changes/index.html
# note that only setuptools specific configuration is
# in this file. Std configuration as defined by pep621
# and configuration for other tools goes into pyproject.toml

[options]
jenshnielsen marked this conversation as resolved.
Show resolved Hide resolved
zip_safe = False
packages = find:
python_requires = >=3.7
install_requires =
numpy>=1.17.0
pyvisa>=1.11.0, <1.12.0
h5py>=3.0.0
websockets>=7.0
jsonschema>=3.0.0
ruamel.yaml>=0.16.0,!=0.16.6
wrapt>=1.10.4
pandas>=1.0.0
xarray>=0.18.0
tabulate>=0.8.0
tqdm>=4.32.2
opencensus>=0.7.10
opencensus-ext-azure>=1.0.4, <2.0.0
matplotlib>=3.3.0
importlib-metadata>=3.6.0,<5.0.0; python_version < '3.10'
importlib-resources>=2.0.0; python_version < '3.9'
typing_extensions>=3.10.0
packaging>=20.0
ipywidgets>=7.5.0,<8.0.0
broadbean>=0.9.1
uncertainties>=3.1.4
h5netcdf>=0.10.0,!=0.14.0
; see https://github.com/h5netcdf/h5netcdf/issues/154
versioningit>=1.1.1
; transitive dependencies. We list these explicitly to
; ensure that we always use versions that do not have
; known security vulnerabilities
ipython>=7.31.1,!=8.0.0
pillow>=9.0.0
rsa>=4.7

[options.package_data]
qcodes =
Expand All @@ -72,24 +19,3 @@ qcodes =
py.typed
dist/schemas/*
dist/tests/station/*

[options.extras_require]
QtPlot = pyqtgraph>=0.11.0
Slack = slack-sdk>=3.4.2
ZurichInstruments = zhinst-qcodes>=0.3
test =
pytest>=6.0.0
PyVisa-sim>=0.4.0
hypothesis>=5.49.0
pytest-xdist>=2.0.0
deepdiff>=5.0.2
pytest-mock>=3.0.0
pytest-rerunfailures>=5.0.0
lxml>=4.3.0
types_requests>=0.1.8
types-tabulate>=0.1.0
Sphinx>=4.1.2

[options.entry_points]
console_scripts =
qcodes-monitor = qcodes.monitor.monitor:main
20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import setuptools
from setuptools import setup
from versioningit import get_cmdclasses

# this file does not contain configuration
# std configuration as defined by pep621
# is in pyproject.toml
# and setuptools specific config in setup.cfg

if int(setuptools.__version__.split(".")[0]) < 61:
astafan8 marked this conversation as resolved.
Show resolved Hide resolved
raise RuntimeError(
"At least setuptools 61 is required to install qcodes from source"
astafan8 marked this conversation as resolved.
Show resolved Hide resolved
)

try:
import pip

if int(pip.__version__.split(".")[0]) < 19:
raise RuntimeError("At least pip 19 is required to install qcodes from source")
except ImportError:
# we are not being executed from pip so pip version is not important
pass

if __name__ == "__main__":
setup(
cmdclass=get_cmdclasses(),
Expand Down