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

infra: move requirements to a pyproject file and set up hatch env #440

Merged
merged 15 commits into from
Dec 5, 2023
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r test/integ_tests/requirements.txt
pip install hatch
- name: Run integ tests
run: |
pytest -n auto -ra -v --durations=0 test/integ_tests/
hatch run test
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["hatchling", "hatch-requirements-txt"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these files? Will they be included in this pr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build-backend = "hatchling.build"

[project]
name = "amazon-braket-examples"
version = "0.0.1"
description = 'Example notebooks that show how to apply quantum computing with Amazon Braket.'
readme = "README.md"
requires-python = ">=3.9"
license = "apache-2.0"
keywords = []
authors = [{name = "Amazon Web Services"},]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dynamic = ["dependencies"]

[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]

[project.urls]
Documentation = "https://github.com/amazon-braket/amazon-braket-examples#readme"
Issues = "https://github.com/amazon-braket/amazon-braket-examples/issues"
Source = "https://github.com/amazon-braket/amazon-braket-examples"

[tool.hatch.envs.default]
dependencies = [
"jupyter",
"nbconvert",
"pytest",
"pytest-rerunfailures",
"pytest-xdist",
"testbook",
]
[tool.hatch.envs.default.scripts]
test = "pytest -n auto -ra -v --durations=0 test/integ_tests/"


[[tool.hatch.envs.all.matrix]]
python = ["3.9", "3.10", "3.11"]
19 changes: 0 additions & 19 deletions test/integ_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +0,0 @@
amazon-braket-sdk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we no longer need this file? Are we just merging this with the requirements file for NBIs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was to address the discussed proposal around not installing unpinned dependencies and instead using just the requirements dependencies.

amazon-braket-pennylane-plugin
cvxpy
ipython<8.17
matplotlib
ml-dtypes==0.2.0
nbconvert
pandas
pennylane
PennyLane_Lightning<=0.32
pytest
pytest-rerunfailures
pytest-xdist
qiskit_braket_provider
testbook
jupyter
jax
jaxlib
optax