-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Move the compiled eccs to a separate package #517
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #517 +/- ##
==========================================
+ Coverage 83.64% 83.96% +0.32%
==========================================
Files 60 61 +1
Lines 6572 6685 +113
Branches 6090 6191 +101
==========================================
+ Hits 5497 5613 +116
+ Misses 797 790 -7
- Partials 278 282 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple comments checking my understanding, I admit I have not looked at python-pure-wheels.yml
in detail, assuming it is copied from somewhere
@@ -1,3 +1,4 @@ | |||
{ | |||
"tket2-py": "0.1.0a4" | |||
"tket2-py": "0.1.0a4", | |||
"tket2-eccs": "0.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct because it matches the initial version in release-please-config.json. The robot will do the right thing here.
# Note: Be sure to update the dependency versions in [project.dependencies] as well | ||
# | ||
# Poetry does not currently follow PEP 621, it will be supported on poetry 2 | ||
# https://github.com/python-poetry/poetry/issues/3332 | ||
tket2_eccs = { path = "tket2-eccs", develop = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange. I think the [project] section below is what gets published to pypi, and this is what is used when you are pointing to the git repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is abusing the inconsistent dependency definitions (see PR linked in the comment) to work around not being able to define local path + pypi dependencies.
poetry
uses tool.poetry.dependencies
to define the dependency, so we tell it to use the local project (develop = true makes it so changes in tket2_eccs get reflected in the poetry env)
When the wheels get built however their metadata is computed using project.dependencies
, so we reference the (currently unpublished) package there.
.pre-commit-config.yaml
Outdated
@@ -85,7 +85,8 @@ repos: | |||
- id: py-test | |||
name: pytest | |||
description: Run python tests | |||
entry: poetry run -- sh -c "maturin develop && pytest --cov=./ --cov-report=html" | |||
# Ensure that we are using the local version of `tket2-eccs` and not the one from PyPI | |||
entry: poetry run -- sh -c "poetry install -C tket2-eccs & maturin develop && pytest --cov=./ --cov-report=html" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not look right. I would expect
poetry install -C tket2-eccs && poetry run -- sh -c "maturin develop && pytest --cov=./ --cov-report=html"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annoyingly, pre-commit fails if you try to use &&
on a command
No arguments expected for "install" command, got "&&"
I realize that I wrote &
instead of &&
though
@@ -56,4 +56,4 @@ See [DEVELOPMENT.md] for more information. | |||
|
|||
This project is licensed under Apache License, Version 2.0 ([LICENCE][] or http://www.apache.org/licenses/LICENSE-2.0). | |||
|
|||
[LICENCE]: ./LICENCE | |||
[LICENCE]: https://github.com/CQCL/tket2/blob/main/LICENCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the other way, if LICENSE ever changed this would be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to mention this. We need an absolute path. The LICENCE link on pypi's README is currently broken due to this.
https://pypi.org/project/tket2/
I added a small drive-by to strip symbols from the compiled tket2-py lib. The final wheel size improvement, after running
|
🤖 I have created a release *beep* *boop* --- <details><summary>tket2-py: 0.2.0</summary> ## [0.2.0](tket2-py-v0.1.0...tket2-py-v0.2.0) (2024-08-01) ### ⚠ BREAKING CHANGES * increased minimum required version of hugr to 0.9.0 * `.rwr` ECC files generated with older versions are no longer supported. Please recompile them, or compress the file with `zstd`. ### Features * Add timeout options and stats to Badger ([#496](#496)) ([32a9885](32a9885)) * Compress binary ECCs using zlib ([#498](#498)) ([d9a713c](d9a713c)) * Expose advanced Badger timeout options to tket2-py ([#506](#506)) ([fe7d40e](fe7d40e)) * Move the compiled eccs to a separate package ([#517](#517)) ([7247cc6](7247cc6)) ### Bug Fixes * Recompile ecc sets after [#441](#441) ([#484](#484)) ([1122fa4](1122fa4)) ### Miscellaneous Chores * bump hugr version to 0.10.0 ([#508](#508)) ([eca258b](eca258b)) </details> <details><summary>tket2-eccs: 0.1.0</summary> ## 0.1.0 (2024-08-01) ### Features * Move the compiled eccs to a separate package ([#517](#517)) ([7247cc6](7247cc6)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
Closes #486. We should merge this before publishing the next alpha.
I checked that the generated wheels for
tket2-py
contain the correct (non-local) dependency ontket2_eccs
.The pure-python wheels ci job is copied from
hugr-py
.Release-As: 0.1.0