-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from sbalian/misc-improvements
Misc improvements
- Loading branch information
Showing
31 changed files
with
1,163 additions
and
1,764 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,68 @@ | ||
name: Tests | ||
name: Testing, type checking and linting | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
on: [push] | ||
|
||
jobs: | ||
python: | ||
|
||
runs-on: ubuntu-latest | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Prepare | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Run tests | ||
run: | | ||
tox -e py | ||
test-numpy: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] | ||
exclude: | ||
- os: macos-latest | ||
python-version: '3.11' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install | ||
- name: Prepare | ||
run: | | ||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry.py | ||
python get-poetry.py -y | ||
rm get-poetry.py | ||
source $HOME/.poetry/env | ||
poetry install | ||
poetry install -E numpy | ||
poetry install -E analysis | ||
- name: Build | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Run tests | ||
run: | | ||
source $HOME/.poetry/env | ||
poetry build | ||
- name: Lint | ||
tox -e numpy | ||
- name: Check types | ||
run: | | ||
source $HOME/.poetry/env | ||
poetry run isort . --check-only | ||
poetry run black --check . | ||
poetry run flake8 . | ||
poetry run mypy qrandom | ||
- name: Test | ||
mkdir .mypy_cache | ||
tox -e mypy | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Prepare | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Lint | ||
run: | | ||
source $HOME/.poetry/env | ||
QRANDOM_API_KEY=key poetry run pytest | ||
tox -e flake8,black,isort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
*.pyc | ||
dist/ | ||
.mypy_cache/ | ||
.pytest_cache/ | ||
__pycache__/ | ||
.tox/ | ||
.python-version | ||
dist/ | ||
*.egg-info/ | ||
TODO | ||
src/qrandom/version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Analysis | ||
|
||
To run the analysis, first install the requirements (includes `quantum-random`): | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Then run the script to generate the plot in `uniform.md`: | ||
|
||
```bash | ||
python generate_plot.py | ||
``` | ||
|
||
The output is written to `random.png`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
scipy | ||
matplotlib | ||
quantum-random |
Oops, something went wrong.