Skip to content

Commit

Permalink
📦 Proper Packaging (#115)
Browse files Browse the repository at this point in the history
* 📦 removed init file and adjusted setup.py

* 🎨 pre-commit fixes

* 🔖 use setuptools-scm for versioning

* 🔧 add `fetch-depth: 0` to checkout for versioning

* 🔧 move to PEP 621 project metadata specification

* 🔧 add coverage extra

* 🔧 add `fetch-depth: 0` to coverage job

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lukas Burgholzer <lukas.burgholzer@jku.at>
  • Loading branch information
3 people authored Oct 3, 2022
1 parent 855175a commit 28cd0d3
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 80 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install MQT Bench
run: pip install -e .
run: pip install -e .[coverage]
- name: Generate Report
run: |
pip install pytest-cov
pytest -v --cov=./ --cov-report=xml
run: pytest -v --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.8"
Expand All @@ -36,6 +38,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.8"
Expand Down
Empty file removed mqt/__init__.py
Empty file.
77 changes: 67 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,73 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools>=45"] # PEP 508 specifications.
requires = [
"setuptools>=61",
"setuptools_scm[toml]>=6.4",
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
build = "cp3*"
archs = "auto64"
test-command = "python -c \"from mqt import bench\""
build-verbosity = 3
[project]
name = "mqt.bench"
description = "MQT Bench - A MQT tool for Benchmarking Quantum Software Tools"
readme = "README.md"
authors = [
{ name = "Nils Quetschlich", email = "nils.quetschlich@tum.de" },
{ name = "Lukas Burgholzer", email = "lukas.burgholzer@jku.at"},
]
keywords = ["MQT", "quantum computing", "benchmarking", "performance", "testing"]
license = { file = "LICENSE" }
requires-python = ">=3.8"
dynamic = ["version"]

[tool.cibuildwheel.linux]
dependencies = [
"qiskit==0.36.0",
"pytket==1.2.2",
"pytket-qiskit==0.25.0",
"pandas==1.3.5",
"flask==2.2.2",
"networkx==2.8.6",
"pytest==7.1.3",
"qiskit_finance==0.3.4",
"qiskit_machine-learning==0.4.0",
"qiskit-nature[pyscf]==0.3.1",
"qiskit_optimization==0.3.2",
"packaging==21.3",
"tqdm==4.64.1",
"importlib_metadata>=3.6; python_version < '3.10'",
"importlib_resources>=5.9; python_version < '3.10'",
]

[tool.cibuildwheel.macos]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
]

[tool.cibuildwheel.windows]
[project.optional-dependencies]
test = ["pytest>=7"]
coverage = ["mqt.bench[test]", "coverage[toml]~=6.5.0", "pytest-cov~=4.0.0"]
dev = ["mqt.bench[coverage]"]

[project.scripts]
"mqt.bench" = "mqt.benchviewer.main:start_server"

[project.urls]
Homepage = "https://github.com/cda-tum/mqtbench"
"Bug Tracker" = "https://github.com/cda-tum/mqtbench/issues"
Discussions = "https://github.com/cda-tum/mqtbench/discussions"
Research = "https://www.cda.cit.tum.de/research/quantum/"

[tool.setuptools.packages.find]
include = ["mqt.*"]

[tool.setuptools_scm]
67 changes: 1 addition & 66 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,3 @@
import os

from setuptools import setup

README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "README.md")
with open(README_PATH) as readme_file:
README = readme_file.read()

setup(
name="mqt.bench",
packages=[
"mqt.benchviewer",
"mqt.benchviewer.src",
"mqt.benchviewer.src.tests",
"mqt.benchviewer.templates",
"mqt.bench",
"mqt.bench.utils",
"mqt.bench.tests",
"mqt.bench.benchmarks",
"mqt.bench.benchmarks.qiskit_application_finance",
"mqt.bench.benchmarks.qiskit_application_ml",
"mqt.bench.benchmarks.qiskit_application_optimization",
"mqt.bench.benchmarks.qiskit_application_nature",
],
version="0.1.3",
python_requires=">=3.8",
license="MIT",
description="MQT Bench - A MQT tool for Benchmarking Quantum Software Tools",
long_description=README,
long_description_content_type="text/markdown",
author="Nils Quetschlich",
author_email="nils.quetschlich@tum.de",
url="https://github.com/cda-tum/mqtbench",
keywords="mqt quantum benchmarking performance testing",
entry_points={
"console_scripts": ["mqt.bench=mqt.benchviewer.main:start_server"],
},
include_package_data=True,
install_requires=[
"qiskit==0.36.0",
"pytket==1.2.2",
"pytket-qiskit==0.25.0",
"pandas==1.3.5",
"flask==2.2.2",
"networkx==2.8.6",
"pytest==7.1.3",
"qiskit_finance==0.3.4",
"qiskit_machine-learning==0.4.0",
"qiskit-nature[pyscf]==0.3.1",
"qiskit_optimization==0.3.2",
"packaging==21.3",
"tqdm==4.64.1",
"importlib_metadata>=3.6; python_version < '3.10'",
"importlib_resources>=5.9; python_version < '3.10'",
],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
],
)
setup()

0 comments on commit 28cd0d3

Please sign in to comment.