-
Notifications
You must be signed in to change notification settings - Fork 230
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
infra: move requirements to a pyproject file and set up hatch env #440
Conversation
This will use hatch as a trial of the tooling for Braket. This is a 2 way door and a follow up PR can be released to remove this should the case arise. |
@@ -0,0 +1,134 @@ | |||
[build-system] | |||
requires = ["hatchling", "hatch-requirements-txt"] |
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.
Are these files? Will they be included in this pr?
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.
These are the build systems dependencies
https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#build-time-dependencies
pyproject.toml
Outdated
"typing", | ||
] | ||
|
||
[tool.black] |
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.
Where will this actually be applied? In the notebooks or in the .py files that notebooks use?
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 not applied currently. I can remove it to avoid confusion but I figured it would be alright to leave in for people to use and build off of.
pyproject.toml
Outdated
[tool.ruff] | ||
target-version = "py39" | ||
line-length = 120 | ||
select = [ |
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.
Where did you get this list from? Again, not sure where/how this applies.
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 was from hatch --init
. I have left this as a linting starting point. I can remove to avoid confusion.
@@ -1,19 +0,0 @@ | |||
amazon-braket-sdk |
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.
why do we no longer need this file? Are we just merging this with the requirements file for NBIs?
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 was to address the discussed proposal around not installing unpinned dependencies and instead using just the requirements dependencies.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Issue #, if available:
Description of changes:
This pyproject file uses hatch for management. With this, we can define testing environments including the default one which is being used here. Currently, this is a sloppy implementation and generalizes for our use case. There are a few improvements to be done based on this:
1.1 We can use ipynb specific linters. Still researching this to properly propose something.
hatch run test
takes case of the dependency setup and utilizes the constraints in the pyproject file. A user can still runpip install -e .
to install these dependencies if they wish to use other tools besides hatch.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.