-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add poetry and bump dependencies #701
Add poetry and bump dependencies #701
Conversation
34727ed
to
84179a2
Compare
@@ -49,14 +47,13 @@ def find_package_resource(path, silent_errors=False): | |||
if path.startswith("katrain"): | |||
if not PATHS.get("PACKAGE"): | |||
try: | |||
with pkg_resources.path("katrain", "gui.kv") as p: | |||
PATHS["PACKAGE"] = os.path.split(str(p))[0] | |||
PATHS["PACKAGE"] = str(pkg_resources.files("katrain").absolute()) |
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 drive-by improvement to use the package path directly instead of getting full path to file and discarding the file part.
pyproject.toml
Outdated
{path = "katrain/sounds/*"}, | ||
{path = "katrain/img/*"}, | ||
{path = "katrain/img/flags/*"}, | ||
{path = "katrain/i18n/*"} |
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 logic from setup.py is more sophisticated, but the simpler configuration here seems to be equivalent.
-- setup.py
package_data = {"": ["*.json", "*.kv", "*.wav"], "katrain": [], "tests": []}
def include_data_files(directory):
I ran the python3 setup.py sdist
and poetry build
with verbose mode and diffed their output to confirm that nothing extra is included. They are nearly the same. The setup.py included the tests/*.py
that poetry doesn't.
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.
can we remove it entirely and just rely on the default? I can't remember why this was added in the first place 🤔
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.
Sure, I also verified that the same files get included.
@@ -1,3 +1,4 @@ | |||
[flake8] | |||
ignore = E501, E203, W503, E402 # line length, space before binary op, line break before binary op, import not at top | |||
# line length, space before binary op, line break before binary op, import not at top | |||
ignore = E501, E203, W503, E402 |
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 config was invalid. Flake8 was failing with:
ValueError: Error code '#' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'
Can you also check the docs and see if they refer to requirements.txt? |
f01ceda
to
d4e538e
Compare
Rebased on the sanderland:1.15.0 branch. There should be no more references to the older build system, in particular to the |
Thank you! poetry-dynamic-versioning is a neat plugin as well. |
https://github.com/sanderland/katrain/actions/runs/10434894929/job/28898286719
edit: fixed by
|
Sorry about that, testing on a clean virtual env could've caught it |
The configuration with pyproject.toml is a more declarative convention.
One breaking change is that the minimal version of Python is raised 3.7 to 3.9 to upgrade the dependencies to the most recent versions.
I verified that katrain works and ran the CI scripts manually for the test and release workflows. Testing the MacOSX packaging seems to be much easier with CI.