Skip to content

Commit

Permalink
Export setuptools requirements files.
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix committed Oct 23, 2023
1 parent 77a5eda commit b25d189
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5.1'
poetry-version: '1.6.1'
- name: Install Python
uses: actions/setup-python@v4
with:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
poetry-version: [1.5.1]
poetry-version: [1.6.1]
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v3
Expand All @@ -24,10 +24,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Check Poetry lock file status
run: poetry lock --check
- name: Check shell scripts
uses: ludeeus/[email protected]
- name: Check Poetry lock file status
run: poetry lock --check
- name: Check Setuptools requirements files
run: |
./scripts/setuptools_requirements.sh -c
- name: Install coverage tool
run: |
poetry run pip install coverage[toml]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5.1'
poetry-version: '1.6.1'
- name: Install release dependencies
run: pip install -U typer mistletoe
- name: Build packages
Expand Down
198 changes: 198 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
alabaster==0.7.13 ; python_version >= "3.8" and python_version < "3.12"
anyio==4.0.0 ; python_version >= "3.8" and python_version < "3.12"
appnope==0.1.3 ; python_version >= "3.8" and python_version < "3.12" and (platform_system == "Darwin" or sys_platform == "darwin")
argcomplete==3.1.2 ; python_version >= "3.8" and python_version < "3.12"
asteval==0.9.31 ; python_version >= "3.8" and python_version < "3.12"
asttokens==2.4.0 ; python_version >= "3.8" and python_version < "3.12"
attrs==23.1.0 ; python_version >= "3.8" and python_version < "3.12"
autodoc-pydantic==1.9.0 ; python_version >= "3.8" and python_version < "3.12"
babel==2.12.1 ; python_version >= "3.8" and python_version < "3.12"
backcall==0.2.0 ; python_version >= "3.8" and python_version < "3.12"
beautifulsoup4==4.12.2 ; python_version >= "3.8" and python_version < "3.12"
black==23.9.1 ; python_version >= "3.8" and python_version < "3.12"
bleach==6.0.0 ; python_version >= "3.8" and python_version < "3.12"
certifi==2023.7.22 ; python_version >= "3.8" and python_version < "3.12"
cffi==1.15.1 ; python_version >= "3.8" and python_version < "3.12"
cfgv==3.4.0 ; python_version >= "3.8" and python_version < "3.12"
chardet==5.2.0 ; python_version >= "3.8" and python_version < "3.12"
charset-normalizer==3.2.0 ; python_version >= "3.8" and python_version < "3.12"
click==8.1.7 ; python_version >= "3.8" and python_version < "3.12"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "3.12"
comm==0.1.4 ; python_version >= "3.8" and python_version < "3.12"
contourpy==1.1.1 ; python_version >= "3.8" and python_version < "3.12"
coverage==7.3.1 ; python_version >= "3.8" and python_version < "3.12"
cryptography==41.0.4 ; python_version >= "3.8" and python_version < "3.12"
cycler==0.11.0 ; python_version >= "3.8" and python_version < "3.12"
datamodel-code-generator==0.21.5 ; python_version >= "3.8" and python_version < "3.12"
debugpy==1.8.0 ; python_version >= "3.8" and python_version < "3.12"
decorator==5.1.1 ; python_version >= "3.8" and python_version < "3.12"
defusedxml==0.7.1 ; python_version >= "3.8" and python_version < "3.12"
dill==0.3.7 ; python_version >= "3.8" and python_version < "3.12"
distlib==0.3.7 ; python_version >= "3.8" and python_version < "3.12"
dnspython==2.4.2 ; python_version >= "3.8" and python_version < "3.12"
docutils==0.20.1 ; python_version >= "3.8" and python_version < "3.12"
email-validator==2.0.0.post2 ; python_version >= "3.8" and python_version < "3.12"
exceptiongroup==1.1.3 ; python_version >= "3.8" and python_version < "3.11"
executing==1.2.0 ; python_version >= "3.8" and python_version < "3.12"
faker==19.6.2 ; python_version >= "3.8" and python_version < "3.12"
fastjsonschema==2.18.0 ; python_version >= "3.8" and python_version < "3.12"
filelock==3.12.4 ; python_version >= "3.8" and python_version < "3.12"
fonttools==4.42.1 ; python_version >= "3.8" and python_version < "3.12"
furo==2023.8.19 ; python_version >= "3.8" and python_version < "3.12"
future==0.18.3 ; python_version >= "3.8" and python_version < "3.12"
genson==1.2.2 ; python_version >= "3.8" and python_version < "3.12"
h11==0.14.0 ; python_version >= "3.8" and python_version < "3.12"
httpcore==0.17.3 ; python_version >= "3.8" and python_version < "3.12"
httpx==0.24.1 ; python_version >= "3.8" and python_version < "3.12"
hypothesis==6.87.0 ; python_version >= "3.8" and python_version < "3.12"
identify==2.5.29 ; python_version >= "3.8" and python_version < "3.12"
idna==3.4 ; python_version >= "3.8" and python_version < "3.12"
imagesize==1.4.1 ; python_version >= "3.8" and python_version < "3.12"
importlib-metadata==6.8.0 ; python_version >= "3.8" and python_version < "3.10"
importlib-resources==5.13.0 ; python_version >= "3.8" and python_version < "3.10"
inflect==5.6.2 ; python_version >= "3.8" and python_version < "3.12"
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "3.12"
interrogate==1.5.0 ; python_version >= "3.8" and python_version < "3.12"
ipykernel==6.25.2 ; python_version >= "3.8" and python_version < "3.12"
ipython==8.12.2 ; python_version >= "3.8" and python_version < "3.12"
ipywidgets==8.1.1 ; python_version >= "3.8" and python_version < "3.12"
isort==5.12.0 ; python_version >= "3.8" and python_version < "3.12"
jedi==0.19.0 ; python_version >= "3.8" and python_version < "3.12"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "3.12"
jsonschema-spec==0.1.3 ; python_version >= "3.8" and python_version < "3.12"
jsonschema-specifications==2023.7.1 ; python_version >= "3.8" and python_version < "3.12"
jsonschema==4.19.1 ; python_version >= "3.8" and python_version < "3.12"
jupyter-client==8.3.1 ; python_version >= "3.8" and python_version < "3.12"
jupyter-core==5.3.1 ; python_version >= "3.8" and python_version < "3.12"
jupyter-sphinx==0.4.0 ; python_version >= "3.8" and python_version < "3.12"
jupyterlab-pygments==0.2.2 ; python_version >= "3.8" and python_version < "3.12"
jupyterlab-widgets==3.0.9 ; python_version >= "3.8" and python_version < "3.12"
kiwisolver==1.4.5 ; python_version >= "3.8" and python_version < "3.12"
lazy-object-proxy==1.9.0 ; python_version >= "3.8" and python_version < "3.12"
lmfit==1.2.2 ; python_version >= "3.8" and python_version < "3.12"
markdown-it-py==3.0.0 ; python_version >= "3.8" and python_version < "3.12"
markupsafe==2.1.3 ; python_version >= "3.8" and python_version < "3.12"
matplotlib-inline==0.1.6 ; python_version >= "3.8" and python_version < "3.12"
matplotlib==3.7.3 ; python_version >= "3.8" and python_version < "3.12"
mdurl==0.1.2 ; python_version >= "3.8" and python_version < "3.12"
mistletoe==1.2.1 ; python_version >= "3.8" and python_version < "3.12"
mistune==3.0.1 ; python_version >= "3.8" and python_version < "3.12"
mpmath==1.3.0 ; python_version >= "3.8" and python_version < "3.12"
mypy-extensions==1.0.0 ; python_version >= "3.8" and python_version < "3.12"
mypy==1.5.1 ; python_version >= "3.8" and python_version < "3.12"
natsort==8.4.0 ; python_version >= "3.8" and python_version < "3.12"
nbclient==0.8.0 ; python_version >= "3.8" and python_version < "3.12"
nbconvert==7.8.0 ; python_version >= "3.8" and python_version < "3.12"
nbformat==5.9.2 ; python_version >= "3.8" and python_version < "3.12"
nest-asyncio==1.5.8 ; python_version >= "3.8" and python_version < "3.12"
nodeenv==1.8.0 ; python_version >= "3.8" and python_version < "3.12"
numpy==1.24.4 ; python_version >= "3.8" and python_version < "3.12"
openapi-schema-validator==0.4.3 ; python_version >= "3.8" and python_version < "3.12"
openapi-spec-validator==0.5.5 ; python_version >= "3.8" and python_version < "3.12"
packaging==23.1 ; python_version >= "3.8" and python_version < "3.12"
pandas==2.0.3 ; python_version >= "3.8" and python_version < "3.12"
pandocfilters==1.5.0 ; python_version >= "3.8" and python_version < "3.12"
parso==0.8.3 ; python_version >= "3.8" and python_version < "3.12"
pastel==0.2.1 ; python_version >= "3.8" and python_version < "3.12"
pathable==0.4.3 ; python_version >= "3.8" and python_version < "3.12"
pathspec==0.11.2 ; python_version >= "3.8" and python_version < "3.12"
pbr==5.11.1 ; python_version >= "3.8" and python_version < "3.12"
pexpect==4.8.0 ; python_version >= "3.8" and python_version < "3.12" and sys_platform != "win32"
pickleshare==0.7.5 ; python_version >= "3.8" and python_version < "3.12"
pillow==10.0.1 ; python_version >= "3.8" and python_version < "3.12"
pkgutil-resolve-name==1.3.10 ; python_version >= "3.8" and python_version < "3.9"
platformdirs==3.10.0 ; python_version >= "3.8" and python_version < "3.12"
pluggy==1.3.0 ; python_version >= "3.8" and python_version < "3.12"
ply==3.11 ; python_version >= "3.8" and python_version < "3.12"
poethepoet==0.18.1 ; python_version >= "3.8" and python_version < "3.12"
polyfactory==2.9.0 ; python_version >= "3.8" and python_version < "3.12"
prance==23.6.21.0 ; python_version >= "3.8" and python_version < "3.12"
pre-commit==3.4.0 ; python_version >= "3.8" and python_version < "3.12"
prompt-toolkit==3.0.39 ; python_version >= "3.8" and python_version < "3.12"
psutil==5.9.5 ; python_version >= "3.8" and python_version < "3.12"
ptyprocess==0.7.0 ; python_version >= "3.8" and python_version < "3.12" and sys_platform != "win32"
pure-eval==0.2.2 ; python_version >= "3.8" and python_version < "3.12"
py==1.11.0 ; python_version >= "3.8" and python_version < "3.12"
pycparser==2.21 ; python_version >= "3.8" and python_version < "3.12"
pydantic==1.10.12 ; python_version >= "3.8" and python_version < "3.12"
pydantic[email]==1.10.12 ; python_version >= "3.8" and python_version < "3.12"
pydot==1.4.2 ; python_version >= "3.8" and python_version < "3.12"
pygments==2.16.1 ; python_version >= "3.8" and python_version < "3.12"
pylatexenc==2.10 ; python_version >= "3.8" and python_version < "3.12"
pyparsing==3.1.1 ; python_version >= "3.8" and python_version < "3.12"
pyproject-fmt==1.1.0 ; python_version >= "3.8" and python_version < "3.12"
pysnooper==1.2.0 ; python_version >= "3.8" and python_version < "3.12"
pyspnego==0.9.2 ; python_version >= "3.8" and python_version < "3.12"
pytest-httpx==0.22.0 ; python_version >= "3.8" and python_version < "3.12"
pytest-mock==3.11.1 ; python_version >= "3.8" and python_version < "3.12"
pytest-sugar==0.9.7 ; python_version >= "3.8" and python_version < "3.12"
pytest==7.4.2 ; python_version >= "3.8" and python_version < "3.12"
python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "3.12"
pytz==2023.3.post1 ; python_version >= "3.8" and python_version < "3.12"
pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.8" and python_version < "3.12"
pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "3.12"
pyzmq==25.1.1 ; python_version >= "3.8" and python_version < "3.12"
qiskit-experiments==0.4.0 ; python_version >= "3.8" and python_version < "3.12"
qiskit-ibm-experiment==0.3.5 ; python_version >= "3.8" and python_version < "3.12"
qiskit-ibmq-provider==0.19.2 ; python_version >= "3.8" and python_version < "3.12"
qiskit-sphinx-theme==1.16.0 ; python_version >= "3.8" and python_version < "3.12"
qiskit-terra==0.24.2 ; python_version >= "3.8" and python_version < "3.12"
qiskit-terra[visualization]==0.24.2 ; python_version >= "3.8" and python_version < "3.12"
referencing==0.30.2 ; python_version >= "3.8" and python_version < "3.12"
requests-ntlm==1.2.0 ; python_version >= "3.8" and python_version < "3.12"
requests==2.31.0 ; python_version >= "3.8" and python_version < "3.12"
rfc3339-validator==0.1.4 ; python_version >= "3.8" and python_version < "3.12"
rich==13.5.3 ; python_version >= "3.8" and python_version < "3.12"
rpds-py==0.10.3 ; python_version >= "3.8" and python_version < "3.12"
ruamel-yaml-clib==0.2.7 ; platform_python_implementation == "CPython" and python_version < "3.12" and python_version >= "3.8"
ruamel-yaml==0.17.32 ; python_version >= "3.8" and python_version < "3.12"
ruff==0.0.291 ; python_version >= "3.8" and python_version < "3.12"
rustworkx==0.13.1 ; python_version >= "3.8" and python_version < "3.12"
scipy==1.10.1 ; python_version >= "3.8" and python_version < "3.12"
seaborn==0.12.2 ; python_version >= "3.8" and python_version < "3.12"
setuptools-scm==8.0.3 ; python_version >= "3.8" and python_version < "3.12"
setuptools==68.2.2 ; python_version >= "3.8" and python_version < "3.12"
six==1.16.0 ; python_version >= "3.8" and python_version < "3.12"
sniffio==1.3.0 ; python_version >= "3.8" and python_version < "3.12"
snowballstemmer==2.2.0 ; python_version >= "3.8" and python_version < "3.12"
sortedcontainers==2.4.0 ; python_version >= "3.8" and python_version < "3.12"
soupsieve==2.5 ; python_version >= "3.8" and python_version < "3.12"
sphinx-basic-ng==1.0.0b2 ; python_version >= "3.8" and python_version < "3.12"
sphinx==7.1.2 ; python_version >= "3.8" and python_version < "3.12"
sphinxcontrib-applehelp==1.0.4 ; python_version >= "3.8" and python_version < "3.12"
sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.8" and python_version < "3.12"
sphinxcontrib-htmlhelp==2.0.1 ; python_version >= "3.8" and python_version < "3.12"
sphinxcontrib-jquery==4.1 ; python_version >= "3.8" and python_version < "3.12"
sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.8" and python_version < "3.12"
sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.8" and python_version < "3.12"
sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.8" and python_version < "3.12"
stack-data==0.6.2 ; python_version >= "3.8" and python_version < "3.12"
stevedore==5.1.0 ; python_version >= "3.8" and python_version < "3.12"
symengine==0.9.2 ; python_version >= "3.8" and python_version < "3.12" and (platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "amd64" or platform_machine == "arm64")
sympy==1.12 ; python_version >= "3.8" and python_version < "3.12"
tabulate==0.9.0 ; python_version >= "3.8" and python_version < "3.12"
termcolor==2.3.0 ; python_version >= "3.8" and python_version < "3.12"
tinycss2==1.2.1 ; python_version >= "3.8" and python_version < "3.12"
toml==0.10.2 ; python_version >= "3.8" and python_version < "3.12"
tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.12"
tomlkit==0.12.1 ; python_version >= "3.8" and python_version < "3.12"
tornado==6.3.3 ; python_version >= "3.8" and python_version < "3.12"
traitlets==5.10.1 ; python_version >= "3.8" and python_version < "3.12"
typer==0.7.0 ; python_version >= "3.8" and python_version < "3.12"
types-docutils==0.20.0.3 ; python_version >= "3.8" and python_version < "3.12"
types-requests==2.31.0.5 ; python_version >= "3.8" and python_version < "3.12"
types-setuptools==65.7.0.4 ; python_version >= "3.8" and python_version < "3.12"
types-tabulate==0.9.0.3 ; python_version >= "3.8" and python_version < "3.12"
types-tqdm==4.66.0.2 ; python_version >= "3.8" and python_version < "3.12"
types-urllib3==1.26.25.14 ; python_version >= "3.8" and python_version < "3.12"
typing-extensions==4.8.0 ; python_version >= "3.8" and python_version < "3.12"
tzdata==2023.3 ; python_version >= "3.8" and python_version < "3.12"
uncertainties==3.1.7 ; python_version >= "3.8" and python_version < "3.12"
urllib3==2.0.7 ; python_version >= "3.8" and python_version < "3.12"
virtualenv==20.24.5 ; python_version >= "3.8" and python_version < "3.12"
wcwidth==0.2.6 ; python_version >= "3.8" and python_version < "3.12"
webencodings==0.5.1 ; python_version >= "3.8" and python_version < "3.12"
websocket-client==1.6.3 ; python_version >= "3.8" and python_version < "3.12"
websockets==11.0.3 ; python_version >= "3.8" and python_version < "3.12"
widgetsnbextension==4.0.9 ; python_version >= "3.8" and python_version < "3.12"
zipp==3.17.0 ; python_version >= "3.8" and python_version < "3.10"
30 changes: 30 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
anyio==4.0.0 ; python_version >= "3.8" and python_version < "3.12"
certifi==2023.7.22 ; python_version >= "3.8" and python_version < "3.12"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "3.12" and platform_system == "Windows"
dill==0.3.7 ; python_version >= "3.8" and python_version < "3.12"
exceptiongroup==1.1.3 ; python_version >= "3.8" and python_version < "3.11"
h11==0.14.0 ; python_version >= "3.8" and python_version < "3.12"
httpcore==0.17.3 ; python_version >= "3.8" and python_version < "3.12"
httpx==0.24.1 ; python_version >= "3.8" and python_version < "3.12"
idna==3.4 ; python_version >= "3.8" and python_version < "3.12"
mpmath==1.3.0 ; python_version >= "3.8" and python_version < "3.12"
numpy==1.24.4 ; python_version >= "3.8" and python_version < "3.12"
pbr==5.11.1 ; python_version >= "3.8" and python_version < "3.12"
platformdirs==3.10.0 ; python_version >= "3.8" and python_version < "3.12"
ply==3.11 ; python_version >= "3.8" and python_version < "3.12"
psutil==5.9.5 ; python_version >= "3.8" and python_version < "3.12"
pydantic==1.10.12 ; python_version >= "3.8" and python_version < "3.12"
python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "3.12"
python-dotenv==1.0.0 ; python_version >= "3.8" and python_version < "3.12"
qiskit-aer==0.12.2 ; python_version >= "3.8" and python_version < "3.12"
qiskit-terra==0.24.2 ; python_version >= "3.8" and python_version < "3.12"
rustworkx==0.13.1 ; python_version >= "3.8" and python_version < "3.12"
scipy==1.10.1 ; python_version >= "3.8" and python_version < "3.12"
six==1.16.0 ; python_version >= "3.8" and python_version < "3.12"
sniffio==1.3.0 ; python_version >= "3.8" and python_version < "3.12"
stevedore==5.1.0 ; python_version >= "3.8" and python_version < "3.12"
symengine==0.9.2 ; python_version >= "3.8" and python_version < "3.12" and (platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "amd64" or platform_machine == "arm64")
sympy==1.12 ; python_version >= "3.8" and python_version < "3.12"
tabulate==0.9.0 ; python_version >= "3.8" and python_version < "3.12"
tqdm==4.66.1 ; python_version >= "3.8" and python_version < "3.12"
typing-extensions==4.8.0 ; python_version >= "3.8" and python_version < "3.12"
59 changes: 59 additions & 0 deletions scripts/setuptools_requirements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash

# Export setuptools-style requirements.txt and requirements-dev.txt
# dependency specifications from the poetry lock file.
# If -c is passed, check instead of overwriting existing targets.

set -eu

usage() { echo "Usage: $0 [-c]" 1>&2; exit 1; }

while getopts "::c" option; do
case "${option}" in
c)
check=true
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))

check="${check:-false}"

generate() {
poetry export --without-hashes --only main --output "$1"
poetry export --without-hashes --only dev --output "$2"
}

requirements="requirements.txt"
requirements_dev="requirements-dev.txt"

if ${check}; then
tmp_requirements=$(mktemp)
tmp_requirements_dev=$(mktemp)

cleanup() {
# the shell linter doesn't catch that this code is reachable through the exit trap
# shellcheck disable=SC2317
rm -f "${tmp_requirements}"
# shellcheck disable=SC2317
rm -f "${tmp_requirements_dev}"
}

trap cleanup EXIT

[[ ! -f "${requirements}" ]] && echo "${requirements} doesn't exist." && exit 1
[[ ! -f "${requirements_dev}" ]] && echo "${requirements_dev} doesn't exist." && exit 1

generate "${tmp_requirements}" "${tmp_requirements_dev}"

# diff exits with status 1 if the inputs differ
diff -u "${tmp_requirements}" "${requirements}"
diff -u "${tmp_requirements_dev}" "${requirements_dev}"

exit 0
fi

generate "${requirements}" "${requirements_dev}"

0 comments on commit b25d189

Please sign in to comment.