Skip to content

Commit

Permalink
Upload wheels to S3 (#301)
Browse files Browse the repository at this point in the history
* config [github/workflows] - wheelhouse_uploader: upload to S3

* format [workflows] - build: add new line at end of fiel

* refactor [workflows] - build: upload artifacts to github

* bump [workflows/build] - libcloud version

* [test] remove condition to only upload on master

* fix [workflows/build] - set S3 bucket region name

* refactor [build] - only upload wheels from master branch

* fix [test_hafnian_approx] - test_ones_approx: loosen up test condition

This test sometimes fails due to the random seed. The assert condition is loosen so it won't fail that frequently.
  • Loading branch information
sduquemesa authored Nov 18, 2021
1 parent b52f6dc commit a02c686
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,18 @@ jobs:
env:
CIBW_ARCHS_LINUX: ${{matrix.arch}}

- uses: kittaakos/upload-artifact-as-is@v0
- name: Upload wheels to github artifacts
uses: kittaakos/upload-artifact-as-is@v0
if: github.ref == 'refs/heads/master'
with:
path: ./wheelhouse/

- name: Upload Wheels
- name: Upload wheels to xanadu-wheels
if: github.ref == 'refs/heads/master'
run: |
pip install --user https://github.com/joerick/libcloud/archive/v1.5.0-s3fix.zip wheelhouse-uploader
python -m wheelhouse_uploader upload --provider-name S3 --local-folder ./wheelhouse/ xanadu-wheels
pip install --user https://github.com/apache/libcloud/archive/refs/tags/v3.4.1.zip wheelhouse-uploader
python -m wheelhouse_uploader upload --provider-name S3 --region us-east-1 --local-folder ./wheelhouse/ xanadu-wheels
mac-wheels-x86-64:
name: wheels macos
Expand Down Expand Up @@ -109,16 +111,17 @@ jobs:
env:
CIBW_ARCHS_MACOS: ${{matrix.arch}}

- uses: kittaakos/upload-artifact-as-is@v0
- name: Upload wheels to github artifacts
uses: kittaakos/upload-artifact-as-is@v0
if: github.ref == 'refs/heads/master'
with:
path: ./wheelhouse/

- name: Upload Wheels
- name: Upload wheels to xanadu-wheels
if: github.ref == 'refs/heads/master'
run: |
pip install --user https://github.com/joerick/libcloud/archive/v1.5.0-s3fix.zip wheelhouse-uploader
python -m wheelhouse_uploader upload --provider-name S3 --local-folder ./wheelhouse/ xanadu-wheels
pip install --user https://github.com/apache/libcloud/archive/refs/tags/v3.4.1.zip wheelhouse-uploader
python -m wheelhouse_uploader upload --provider-name S3 --region us-east-1 --local-folder ./wheelhouse/ xanadu-wheels
win-wheels:
name: wheels windows
Expand Down Expand Up @@ -159,14 +162,16 @@ jobs:
- name: Build wheels
uses: pypa/[email protected]

- uses: kittaakos/upload-artifact-as-is@v0
- name: Upload wheels to github artifacts
uses: kittaakos/upload-artifact-as-is@v0
if: github.ref == 'refs/heads/master'
with:
path: ./wheelhouse/

- name: Upload Wheels
- name: Upload wheels to xanadu-wheels
if: github.ref == 'refs/heads/master'
run: |
pip install --user https://github.com/joerick/libcloud/archive/v1.5.0-s3fix.zip wheelhouse-uploader
python -m wheelhouse_uploader upload --provider-name S3 --local-folder ./wheelhouse/ xanadu-wheels
pip install --user https://github.com/apache/libcloud/archive/refs/tags/v3.4.1.zip wheelhouse-uploader
python -m wheelhouse_uploader upload --provider-name S3 --region us-east-1 --local-folder ./wheelhouse/ xanadu-wheels
2 changes: 1 addition & 1 deletion thewalrus/tests/test_hafnian_approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def test_ones_approx(n):
A = np.float64(np.ones([2 * n, 2 * n]))
haf = hafnian(A, approx=True, num_samples=10000)
expected = fac(2 * n) / (fac(n) * (2 ** n))
assert np.abs(haf - expected) / expected < 0.15
assert np.abs(haf - expected) / expected < 0.2

0 comments on commit a02c686

Please sign in to comment.