diff --git a/pyproject.toml b/pyproject.toml index 08f2228cc..6877ae3fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,40 @@ [build-system] requires = [ - "setuptools >= 56.0", + "setuptools >= 61.2", "wheel >= 0.29.0", "versioningit >= 1.1.0" ] build-backend = 'setuptools.build_meta' +[project] +name = "qcodes_contrib_drivers" +description = "User contributed drivers for QCoDeS" +classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering",] +requires-python = ">=3.8" +dependencies = [ "qcodes>=0.33.0", "versioningit>=1.1.0",] +dynamic = [ "version",] + +[[project.maintainers]] +name = "QCoDeS Community" +email = "qcodes-support@microsoft.com" + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[project.license] +text = "MIT" + +[project.urls] +Homepage = "https://github.com/QCoDeS/Qcodes_contrib_drivers" +Documentation = "https://qcodes.github.io/Qcodes_contrib_drivers/" +Source = "https://github.com/qcodes/qcodes_contrib_drivers" +Tracker = "https://github.com/QCoDeS/Qcodes_contrib_drivers/issues" + +[project.optional-dependencies] +test = [ "pytest>=6.2.2", "pytest-mock", "mypy>=0.940", "pytest-cov>=3.0.0", "coverage[toml]>=6.2", "pyvisa-sim",] +docs = [ "sphinx", "sphinx_rtd_theme", "nbsphinx",] + [tool.mypy] strict_optional = true disallow_untyped_decorators = true diff --git a/setup.cfg b/setup.cfg index 27e476920..145b74fdd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,47 +1,12 @@ +# 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 + [metadata] -name = qcodes_contrib_drivers -maintainer = QCoDeS Community -maintainer_email = qcodes-support@microsoft.com -description = User contributed drivers for QCoDeS -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://github.com/QCoDeS/Qcodes_contrib_drivers -classifiers = - Development Status :: 3 - Alpha - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Scientific/Engineering -license = MIT license_files = LICENSE_TEKTRONIX_AWG520_KEITHLEY_2700 LICENSE -project_urls = - Documentation = https://qcodes.github.io/Qcodes_contrib_drivers/ - Source = https://github.com/qcodes/qcodes_contrib_drivers - Tracker = https://github.com/QCoDeS/Qcodes_contrib_drivers/issues [options] zip_safe = False packages = find: -python_requires = >=3.8 -install_requires = - qcodes>=0.33.0 - versioningit>=1.1.0 - -[options.extras_require] -test = - pytest>=6.2.2 - pytest-mock - mypy>=0.940 - pytest-cov>=3.0.0 - coverage[toml]>=6.2 - pyvisa-sim -docs = - sphinx - sphinx_rtd_theme - nbsphinx diff --git a/setup.py b/setup.py index 58b44f09e..b095ba7af 100644 --- a/setup.py +++ b/setup.py @@ -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: + raise RuntimeError( + "At least setuptools 61 is required to install qcodes-contrib-drivers from source" + ) + +try: + import pip + + if int(pip.__version__.split(".")[0]) < 19: + raise RuntimeError("At least pip 19 is required to install qcodes-contrib-drivers 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(),