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

Modernize setup and build infrastructure #109

Merged
merged 49 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5ccbee2
cleaning up build to be updated to current pep standards
Jun 3, 2022
22aa4b5
update setup.cfg package_dir
Jun 3, 2022
65cceed
more setup,cfg updates
Jun 3, 2022
f703967
Update setup.py
astafan8 Jun 3, 2022
c8e1294
Update _version.py
astafan8 Jun 3, 2022
57f9b78
Merge branch 'trmorgan/update-build-setup' of https://github.com/QCoD…
Jun 3, 2022
407eb57
Update pyproject.toml
astafan8 Jun 3, 2022
fd175de
Merge branch 'trmorgan/update-build-setup' of https://github.com/QCoD…
Jun 3, 2022
87cadfa
Update setup.cfg
astafan8 Jun 3, 2022
a63553b
Update setup.cfg
astafan8 Jun 3, 2022
1a07c3c
Merge branch 'trmorgan/update-build-setup' of https://github.com/QCoD…
Jun 3, 2022
3e710db
Update pyproject.toml
astafan8 Jun 3, 2022
9804629
Merge branch 'trmorgan/update-build-setup' of https://github.com/QCoD…
Jun 3, 2022
1db0609
Update _version.py
astafan8 Jun 3, 2022
14bbd70
Merge branch 'master' into trmorgan/update-build-setup
trevormorgan Jun 3, 2022
54f4683
new line
trevormorgan Jun 3, 2022
c8cd3c5
removing comment about black ver sync with precommit
trevormorgan Jun 3, 2022
3dbbab7
removing mypy overrides
trevormorgan Jun 3, 2022
f202eb6
workflow for pypi upload
trevormorgan Jun 3, 2022
64d41e0
add py.typed
trevormorgan Jun 3, 2022
bd968f6
updates to setup.cfg
trevormorgan Jun 3, 2022
c248a09
missing .
trevormorgan Jun 3, 2022
5fab29f
add darker to workflow
Jun 5, 2022
2876a6d
Merge branch 'trmorgan/update-build-setup' of https://github.com/QCoD…
Jun 5, 2022
5bfdd76
adding min-version to CI
Jun 5, 2022
7c7dd69
non-local run to CI workflow
Jun 5, 2022
859f7fb
updates to non-local workflow yaml
Jun 5, 2022
bad8c59
adding black anddarker to project.toml
Jun 5, 2022
532a176
removing darker/precommit and min pytest from this PR
Jun 5, 2022
c1cf412
adding requirments.txt
Jun 5, 2022
698a7ce
win32 platform fix
Jun 5, 2022
6768b4b
update ci to install from requirments.txt and setup.cfg
Jun 5, 2022
8dc1f74
Update upload_to_pypi.yaml
trevormorgan Jun 5, 2022
133694a
fixing python <= 3.8 dep req
Jun 5, 2022
c2d20f3
Merge branch 'trmorgan/update-build-setup' of https://github.com/QCoD…
Jun 5, 2022
8b24ab4
missing whitespace
Jun 5, 2022
ecb52ab
lock hypothesis due to rounding error
Jun 5, 2022
e4e99d0
updates to include pinned document dependancies
Jun 8, 2022
46f989a
use requirments.txt for docs
Jun 8, 2022
6620906
remove dep locking on hypthesis
Jun 8, 2022
0c5fdbf
version not needed
Jun 8, 2022
aadff7f
set pytest ini default settings
Jun 8, 2022
cac5aca
utf-8
Jun 8, 2022
bc02ea9
pin on patch version
Jun 9, 2022
f10077d
remove unused requirments files
Jun 9, 2022
d0a7687
rm duplicate numpy
Jun 9, 2022
f5c5e2f
missing mypy
Jun 9, 2022
1e3786a
bring back 3.7 for docs buiild
Jun 9, 2022
b0b194e
remove outdatre comment
Jun 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,13 @@ jobs:
uses: actions/cache@v3.0.2
with:
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/test_requirements.txt') }}-${{ hashFiles('**/docs_requirements.txt') }}-${{ hashFiles('**/setup.py') }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-

- name: install test_requirements.txt
- name: install requirements.txt
run: |
pip install -r test_requirements.txt
- name: install docs_requirements.txt
run: |
pip install -r docs_requirements.txt
pip install -r requirements.txt
- name: install broadbean
run: pip install .
- name: Build docs on linux
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
uses: actions/cache@v3.0.2
with:
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/test_requirements.txt') }}-${{ hashFiles('**/setup.py') }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: install test_requirements.txt
- name: install requirements.txt
run: |
pip install -r test_requirements.txt
pip install -r requirements.txt
- name: install broadbean
run: |
pip install .
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/upload_to_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Upload Python Package

on:
push:
tags:
- v*

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3.0.2
- name: Set up Python
uses: actions/setup-python@v3.1.2
with:
python-version: '3.7'
- name: Install build deps
run: pip install --upgrade pip setuptools wheel build
- name: Build
run: |
python -m build
- name: Install Twine
run: pip install twine
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
10 changes: 10 additions & 0 deletions broadbean/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def _get_version() -> str:
from pathlib import Path
import versioningit
import broadbean

project_dir = Path(broadbean.__file__).parent.parent
return versioningit.get_version(project_dir=project_dir)


__version__ = _get_version()
2 changes: 2 additions & 0 deletions broadbean/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
this file marks broadbean as safe for typechecking
https://mypy.readthedocs.io/en/latest/installed_packages.html#installed-packages
2 changes: 0 additions & 2 deletions docs_requirements.txt

This file was deleted.

28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
[build-system]
requires = [
"setuptools >= 56.0",
"wheel >= 0.29.0",
"versioningit ~= 1.1.1",
]
build-backend = 'setuptools.build_meta'

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"

[tool.mypy]
ignore_missing_imports = true
show_error_codes = true
enable_error_code = "ignore-without-code"
warn_unused_ignores = true
warn_unused_configs = true
warn_redundant_casts = true

[tool.versioningit]
default-version = "0.0"

[tool.versioningit.format]
distance = "{next_version}.dev{distance}+{branch}.{vcs}{rev}"
dirty = "{next_version}.dev{distance}+{branch}.{vcs}{rev}.dirty"
distance-dirty = "{next_version}.dev{distance}+{branch}.{vcs}{rev}.dirty"

[tool.versioningit.vcs]
method = "git"
match = ["v*"]

[tool.versioningit.onbuild]
source-file = "broadbean/_version.py"
build-file = "broadbean/_version.py"
119 changes: 119 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# pinned depedancies for CI
alabaster~=0.7.12
argon2-cffi~=21.3.0
argon2-cffi-bindings~=21.2.0
asttokens~=2.0.5
atomicwrites~=1.4.0
attrs~=21.4.0
Babel~=2.10.1
backcall~=0.2.0
beautifulsoup4~=4.11.1
bleach~=5.0.0
certifi~=2022.5.18.1
cffi~=1.15.0
cfgv~=3.3.1
charset-normalizer~=2.0.12
colorama~=0.4.4
contextlib2~=21.6.0
coverage~=6.4.1
cycler~=0.11.0
debugpy~=1.6.0
decorator~=5.1.1
defusedxml~=0.7.1
distlib~=0.3.4
docutils~=0.17.1
entrypoints~=0.4
executing~=0.8.3
fastjsonschema~=2.15.3
filelock~=3.7.1
fonttools~=4.33.3
hypothesis==6.46.7
identify~=2.5.1
idna~=3.3
imagesize~=1.3.0
iniconfig~=1.1.1
ipykernel~=6.13.0
ipython==8.4.0; python_version>='3.8'
ipython==7.31.0; python_version<'3.8'
ipython-genutils~=0.2.0
ipywidgets~=7.7.0
jedi~=0.18.1
Jinja2~=3.1.2
jsonschema~=4.6.0
jupyter~=1.0.0
jupyter-client~=7.3.1
jupyter-console~=6.4.3
jupyter-core~=4.10.0
jupyterlab-pygments~=0.2.2
jupyterlab-widgets~=1.1.0
kiwisolver~=1.4.2
MarkupSafe~=2.1.1
matplotlib~=3.5.2
matplotlib-inline~=0.1.3
mistune~=0.8.4
numpy~=1.21.5; python_version<'3.8'
numpy~=1.22.4; python_version>='3.8'
mypy~=0.950
mypy-extensions~=0.4.3
nbclient~=0.6.4
nbconvert~=6.5.0
nbformat~=5.4.0
nest-asyncio~=1.5.5
nodeenv~=1.6.0
notebook~=6.4.11
packaging~=21.3
pandocfilters~=1.5.0
parso~=0.8.3
pickleshare~=0.7.5
Pillow~=9.1.1
platformdirs~=2.5.2
pluggy~=1.0.0
pre-commit~=2.19.0
prometheus-client~=0.14.1
prompt-toolkit~=3.0.29
psutil~=5.9.1
pure-eval~=0.2.2
py~=1.11.0
pycparser~=2.21
Pygments~=2.12.0
pyparsing~=3.0.9
pyrsistent~=0.18.1
pytest~=7.1.2
pytest-cov~=3.0.0
python-dateutil~=2.8.2
pytz~=2022.1
pywin32==304; sys_platform == 'win32'
pywinpty==2.0.5; sys_platform == 'win32'
PyYAML~=6.0
pyzmq~=23.1.0
qtconsole~=5.3.1
QtPy~=2.1.0
requests~=2.27.1
schema~=0.7.5
Send2Trash~=1.8.0
six~=1.16.0
snowballstemmer~=2.2.0
sortedcontainers~=2.4.0
soupsieve~=2.3.2.post1
Sphinx~=5.0.1
sphinx-rtd-theme~=1.0.0
sphinxcontrib-applehelp~=1.0.2
sphinxcontrib-devhelp~=1.0.2
sphinxcontrib-htmlhelp~=2.0.0
sphinxcontrib-jsmath~=1.0.1
sphinxcontrib-qthelp~=1.0.3
sphinxcontrib-serializinghtml~=1.1.5
stack-data~=0.2.0
terminado~=0.15.0
tinycss2~=1.1.1
toml~=0.10.2
tomli~=2.0.1
tornado~=6.1
traitlets~=5.2.2.post1
typing_extensions~=4.2.0
urllib3~=1.26.9
virtualenv~=20.14.1
wcwidth~=0.2.5
webencodings~=0.5.1
widgetsnbextension~=3.6.0
wincertstore~=0.2
49 changes: 49 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[metadata]
name = broadbean
maintainer = QCoDeS Core Developers
maintainer_email = qcodes-support@microsoft.com
description = Package for easily generating and manipulating signal
pulses. Developed for use with qubits in the quantum
computing labs of Copenhagen, Delft, and Sydney, but
should be generally useable.
keywords = Pulsebuilding signal processing arbitrary waveforms
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/QCoDeS/broadbean
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering
license = MIT

[options.package_data]
broadbean =
py.typed

[options]
include_package_data = True
packages=find:
python_requires = >=3.7
install_requires =
numpy>=1.12.1
matplotlib
schema
versioningit>=1.1.1

[options.extras_require]
test =
pytest>=6.2.2
pytest-cov>=3.0.0
coverage[toml]>=6.2
black>=22.3.0
mypy>=0.960
types-pytz>=2021.3.0
jupyter>=1.0.0
hypothesis>=5.49.0

41 changes: 4 additions & 37 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,7 @@
from setuptools import setup
from versioningit import get_cmdclasses

setup(
name='broadbean',
version='0.10.0',

# We might as well require what we know will work
# although older numpy and matplotlib version will probably work too
install_requires=['numpy>=1.12.1',
'matplotlib',
'schema'],

author='William H.P. Nielsen',
author_email='William.Nielsen@microsoft.com',

description=("Package for easily generating and manipulating signal "
"pulses. Developed for use with qubits in the quantum "
"computing labs of Copenhagen, Delft, and Sydney, but "
"should be generally useable."),

license='MIT',

packages=['broadbean'],

classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10'
],

python_requires=">=3.7",

keywords='Pulsebuilding signal processing arbitrary waveforms',

url='https://github.com/QCoDeS/broadbean'
if __name__ == "__main__":
setup(
cmdclass=get_cmdclasses(),
)
6 changes: 0 additions & 6 deletions test_requirements.txt

This file was deleted.