Skip to content

Commit 448780b

Browse files
committed
Update to use TOML-based setup instead of old-fashioned setup.py
1 parent 118d438 commit 448780b

9 files changed

Lines changed: 73 additions & 78 deletions

File tree

.bumpversion.cfg

Lines changed: 0 additions & 8 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ lint:
1717
@${PYTHON} -m flake8 ${SIMULAQRON_DIR} ${EXAMPLES_DIR} ${TEST_DIR}
1818

1919
test-deps:
20-
@${PYTHON} -m pip install -r test_requirements.txt
20+
@${PYTHON} -m pip install .\[test\]
2121

2222
requirements python-deps:
23-
@cat requirements.txt | xargs -n 1 -L 1 $(PIP) install
23+
@${PYTHON} -m pip install .
2424

2525
install-optional: install
26-
@cat optional-requirements.txt | xargs -n 1 -L 1 $(PIP) install
26+
@${PYTHON} -m pip install .\[opt\]
2727

2828
_reset:
2929
@${PYTHON} ${RESET_FILE}

optional-requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

pyproject.toml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[build-system]
2+
requires = ["setuptools >= 77.0.3", "wheel", "setuptools-scm>=8"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
local_scheme = "no-local-version" # exclude "+<hash>" from version name so we can upload to Test PyPI
7+
8+
[project]
9+
name = "simulaqron"
10+
dynamic = ["version"]
11+
dependencies = [
12+
"numpy>=1.14.0,<2.0.0",
13+
"scipy>=1.1.0,<2.0.0",
14+
"twisted>=24.0.0",
15+
"networkx>=3.0,<4.0",
16+
"click>=8.0,<9.0",
17+
"daemons>=1.3.0,<2.0.0",
18+
"netqasm>=1.0.0,<2.0.0"
19+
]
20+
requires-python = ">=3.8,<3.13"
21+
authors = [
22+
{name = "Axel Dahlberg", email = "e.a.dahlberg@tudelft.nl"}
23+
]
24+
maintainers = [
25+
{name = "Diego Rivera", email = "d.a.g.a.rivera@tudelft.nl"}
26+
]
27+
description = "A simulator for developing Quantum Internet software"
28+
readme = "README.md"
29+
license = "MIT"
30+
license-files = ["LICENCE"]
31+
keywords = ["egg", "bacon", "sausage", "tomatoes", "Lobster Thermidor"]
32+
classifiers = [
33+
"Programming Language :: Python :: 3.8",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Programming Language :: Python :: 3.12",
37+
"Operating System :: Unix",
38+
"Operating System :: MacOS"
39+
]
40+
41+
[project.optional-dependencies]
42+
test = [
43+
"flake8>=5.0.0,<6.0.0",
44+
"pytest >=7.1, <8.0"
45+
]
46+
opt = [
47+
"projectq<=0.8.0",
48+
"qutip"
49+
]
50+
dev = [
51+
"sphinx>=7.2.6, <8.0",
52+
"sphinx-rtd-theme",
53+
"build",
54+
"twine",
55+
"pylint",
56+
"pyink",
57+
"pytest",
58+
"mypy",
59+
]
60+
61+
[tool.setuptools.packages.find]
62+
exclude = ["tests", "docs", "examples"]
63+
64+
[project.scripts]
65+
simulaqron = "simulaqron.simulaqron:cli"
66+
67+
[project.urls]
68+
Homepage = "https://github.com/SoftwareQuTech/SimulaQron"

requirements.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

simulaqron/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
from simulaqron.toolbox.reset import check_config_files
22

3-
__version__ = '4.0.0'
4-
53
# Create default config files if there are none
64
check_config_files()

simulaqron/simulaqron.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ def cli():
7171
###########
7272
# version #
7373
###########
74+
import importlib.metadata as metadata
7475

7576
@cli.command()
7677
def version():
7778
"""
7879
Prints the version of simulqron.
7980
"""
80-
print(simulaqron.__version__)
81+
print(metadata.version('simulaqron'))
8182

8283

8384
#################

test_requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)