-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New sampler implementation - Serialization to the abstract representation - Flexible sequence drawing - Simulation with modulated output
- Loading branch information
Showing
85 changed files
with
5,670 additions
and
2,501 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
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit if something fails | ||
set -e | ||
|
||
# Find and change to the repository directory | ||
repo_dir=$(git rev-parse --show-toplevel) | ||
cd "${repo_dir}" | ||
|
||
# Removing existing files in /dist | ||
rm -rf dist | ||
|
||
packages=$(cat packages.txt) | ||
# Build the pulser packages | ||
for pkg in $packages | ||
do | ||
echo "Packaging $pkg" | ||
python $pkg/setup.py -q bdist_wheel -d "../dist" | ||
rm -r $pkg/build | ||
done | ||
|
||
# Build the pulser metapackage | ||
python setup.py -q bdist_wheel -d "dist" | ||
rm -r build | ||
|
||
echo "Built wheels:" | ||
ls dist |
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,79 @@ | ||
name: Upload Release Package to PyPI | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out Pulser | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build packages | ||
shell: bash | ||
run: ./.github/scripts/package.sh | ||
- name: Publish to TestPyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }} | ||
run: twine upload --repository testpypi dist/* | ||
- name: Install from TestPyPI | ||
timeout-minutes: 5 | ||
shell: bash | ||
run: | | ||
version="$(head -1 VERSION.txt)" | ||
until pip install -i https://test.pypi.org/simple/ pulser==$version --extra-index-url https://pypi.org/simple | ||
do | ||
echo "Failed to install from TestPyPI, will wait for upload and retry." | ||
sleep 30 | ||
done | ||
- name: Test the installation | ||
# Installs pytest from dev_requirements.txt (in case it has a version specifier) | ||
run: | | ||
grep -e pytest dev_requirements.txt | sed 's/ //g' | xargs pip install | ||
pytest | ||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: twine upload dist/* | ||
|
||
check-release: | ||
needs: deploy | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Check out Pulser | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Pulser from PyPI | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pulser | ||
- name: Test the installation | ||
shell: bash | ||
run: | | ||
version="$(head -1 VERSION.txt)" | ||
python -c "import pulser; assert pulser.__version__ == '$version'" | ||
grep -e pytest dev_requirements.txt | sed 's/ //g' | xargs pip install | ||
pytest |
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,31 @@ | ||
name: Pulser setup | ||
description: "Sets up Python and installs Pulser." | ||
inputs: | ||
python-version: | ||
description: Python version | ||
required: false | ||
default: '3.9' | ||
extra-packages: | ||
description: Extra packages to install (give to grep) | ||
required: false | ||
default: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: 'pip' | ||
- name: Install Pulser | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e ./pulser-core -e ./pulser-simulation | ||
- name: Install extra packages from the dev requirements | ||
if: "${{ inputs.extra-packages != '' }}" | ||
shell: bash | ||
run: | | ||
grep -e ${{ inputs.extra-packages }} dev_requirements.txt \ | ||
| sed 's/ //g' \ | ||
| xargs pip install |
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,25 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
full-tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Check out Pulser | ||
uses: actions/checkout@v3 | ||
- name: Pulser + pytest setup | ||
uses: ./.github/workflows/pulser-setup | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
extra-packages: pytest | ||
- name: Run the unit tests & generate coverage report | ||
run: pytest --cov --cov-fail-under=100 |
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,48 @@ | ||
name: version | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'VERSION.txt' | ||
|
||
jobs: | ||
validate-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out base branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.base.ref }} | ||
- name: Get old version | ||
run: | | ||
old_version="$(head -1 VERSION.txt)" | ||
echo "Old version: $old_version" | ||
echo "old_version=$old_version" >> $GITHUB_ENV | ||
- name: Check out head branch | ||
uses: actions/checkout@v3 | ||
- name: Get new version | ||
run: | | ||
new_version="$(head -1 VERSION.txt)" | ||
echo "New version: $new_version" | ||
echo "new_version=$new_version" >> $GITHUB_ENV | ||
- name: Compare versions | ||
run: dpkg --compare-versions "${{ env.old_version }}" lt "${{ env.new_version }}" | ||
- name: Check stable version validity | ||
if: github.event.pull_request.base.ref == 'master' | ||
run: | | ||
pattern=^\(0\|[1-9]\d*\)\.\(0\|[1-9]\d*\)\.\(0\|[1-9]\d*\)$ | ||
if [[ ${{ env.new_version }} =~ $pattern ]]; then | ||
echo "New version is valid."; exit 0 | ||
else | ||
echo "New version is invalid."; exit 1 | ||
fi | ||
- name: Check development version validity | ||
if: github.event.pull_request.base.ref != 'master' | ||
run: | | ||
pattern=^\(0\|[1-9]\d*\)\.\(0\|[1-9]\d*\)dev\(0\|[1-9]\d*\)$ | ||
if [[ ${{ env.new_version }} =~ $pattern ]]; then | ||
echo "New version is valid."; exit 0 | ||
else | ||
echo "New version is invalid."; exit 1 | ||
fi | ||
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
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,4 +1,3 @@ | ||
include README.md | ||
include requirements.txt | ||
include LICENSE | ||
include VERSION.txt |
Oops, something went wrong.