-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Build] Generate traits rather than hard-code them #15
[Build] Generate traits rather than hard-code them #15
Conversation
|
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.
Sorry not the most comprehensive of reviews (hopefully @feltech will be able to apply his usual 🦅 👁️ ), but looks great to me, nice one! Love how simple it is to get generation working in setup.py. Good job remembering to update README.md
too! 👍
Mostly minor pedant notes.
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.
Looks good, all minor stuff.
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.
(testenv) OpenAssetIO-MediaCreation (work/10-gen-traits) ✗ python -m pip install .
Processing /Users/tomcowland/dev/OpenAssetIO-MediaCreation
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
...
Complete output (14 lines):
error: Multiple top-level packages discovered in a flat-layout: ['ignoreme', 'decisions'].
[fix] Its no longer generating |
@elliotcmorris I've attempted to adjust the approval settings for actions here (as they don't behave as their docs say, for some reason), so maybe they'll run on the next push. |
Annoying that that happened, as I installed an autoformatter to do the indentation for me, (just the redhat one that had a code extension.) I'm guessing that we don't have a yaml formatter standard as of yet. |
It looks like we are gonna have to do the .gitkeep/readme in an empty dir approach, explicitly defining a package (to solve the issue of it thinking Was wondering thoughts on doing packages in
I think it's fine, this is clearly the way the wind is blowing. |
Thanks for checking, I liked your
I'd be happy with that too, as were still in alpha. |
@foundrytom @feltech CI passes on fork |
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.
Nice one @elliotcmorris LGTM
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.
Minor notes, otherwise LGTM
Rather than have manually maintained traits, integrate traitgen to generate the traits automatically in the build. Issue #10 Signed-off-by: Elliot Morris <elliot.morris@foundry.com>
Add import tests to mediacreation, to check that the generated traits function. Issue #10 Signed-off-by: Elliot Morris <elliot.morris@foundry.com>
Run pytest on PRs, so we can have some CI going. Issue #10 Signed-off-by: Elliot Morris <elliot.morris@foundry.com>
Remove the tests that were testing the manually rolled traits. Now that the traits are autogenerated, we rely on the tests in openassetio-traitgen Issue #10 Signed-off-by: Elliot Morris <elliot.morris@foundry.com>
Add information about the new traitgen approach to the readme. Signed-off-by: Elliot Morris <elliot.morris@foundry.com>
4413021
to
ae8c609
Compare
|
||
# Move the source trait yaml to the package directory. | ||
copyfile( | ||
"traits.yml", os.path.join(self.build_lib, "openassetio_mediacreation", "traits.yml") |
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 should be handled as package data. See https://setuptools.pypa.io/en/latest/userguide/datafiles.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.
We logged an issue for this : #16
We did a short initial investigation, to see if it would "just work," but unfortunately the install was running into trouble identifying package data, I suspect related to the problems we were seeing around setuptools not figuring as as a full "package" due to generating after the fact.
But we didn't dig very far, are planning to go back later and get to it properly.
Closes #10
Remove hand rolled traits, and replace them with generated ones via
openassetio-traitgen
integration.This is so we can avoid having to manually write and maintain custom traits, as it's too much of a maintenance burden.
This effectively unlocks further integration of mediacreation into other integrations, as traits can now be trivially added if neccesary.
Testing
The hand rolled traits had a minimal set of tests, these have been removed in favour of import tests, as we trust the traits coming out of traitgen, and we don't want to roll tests for every generated trait.
However, prior to removal, these tests were run against the generated traits, (you can see the tests were only removed in the final commit,) to verify that the traits exhibited the same behaviour before and after the swap over.
As this is a first time merge of CI cross-repo, please find the action runs on this PR targetting my fork :
elliotcmorris#2