Closed himkt closed 7 months ago
Hi @himkt! Thank you for providing the report. I will try to conduct a similar verification myself. I haven't been using poetry regularly, so my verification was insufficient. Please wait a little. I will share the information reproduced in my environment.
Thank you @himkt! I have figured out the cause of the error.
The following poetry command retrieves dependency information from https://pypi.org/pypi/nagisa/json
. In this command, the dependent libraries are ['six', 'numpy', 'DyNet']
, and it seems that the conditions in install_requires are not functioning correctly.
poetry add nagisa
You can check with this code.
import requests
package_name = "nagisa"
url = f"https://pypi.org/pypi/{package_name}/json"
response = requests.get(url)
data = response.json()
dependencies = data.get("info", {}).get("requires_dist", [])
print(dependencies)
Also, when adding GitHub or wheel directly in the poetry command, it is possible to execute switch_install_requires directly in that environment, and it correctly specifies DyNet38.
poetry add git+https://github.com/taishi-i/nagisa.git
As a solution to this problem, it is necessary to correct the following part.
def switch_install_requires():
major = sys.version_info.major
minor = sys.version_info.minor
if os.name == 'posix' and major == 3 and minor > 7:
return ['six', 'numpy', 'DyNet38']
else:
return ['six', 'numpy', 'DyNet']
Since it involves handling dependencies, it is necessary to conduct sufficient testing and add a new wheel to PyPI. Therefore, once sufficient testing has been completed, I will release a version addressing this issue, so please wait a little longer.
Wow, thank you so much for your blazing fast investigation (did you read the codebase of poetry...?). 😮 And I understand the current status, I'll wait the next release!
Just for my curiosity: will you continue to support Python<=3.7 (if the minimum python requirements were updated to py38 simply, switch_install_requires
would no longer necessary)?
Hi @himkt!
Yes. Just to be sure, I checked the contents of the poetry code! I referred to this part.
Currently, to maintain consistency and stability in code processing, this repository is adopting a policy of making only minimal changes. In the future, when significant changes become inevitable, I plan to discontinue the provision of Python libraries that have been deprecated.
Regarding the recent error, the issue was that the dependency library information in nagisa-0.2.10.tar.gz
was not correctly included. This was due to my wheel build environment being outdated and unable to set the correct library dependencies.
I resolved the issue where Poetry could not be installed this time by first updating pip, wheel, and build to the latest versions, and then executing python -m build
to construct a tar.gz that includes the correct dependencies of the library.
An updated wheel has been released (nagisa v0.2.11), and with it, I've managed to use nagisa
with poetry in my Python 3.10 environment. Could you please verify if it works in your environment as well?
More detailed information about this error will be shared at nagisa v0.2.11 of release.
Thank you so much for your work and clarification! I understand the policy about dependencies. 👍
Regarding the recent error, the issue was that the dependency library information in nagisa-0.2.10.tar.gz was not correctly included. This was due to my wheel build environment being outdated and unable to set the correct library dependencies.
Aha, I see. I also succeeded to add nagisa==0.2.11
to dependencies in a fresh py310+ environment and konoha package as well (https://github.com/himkt/konoha/pull/203)! 🎉
Sorry for the inconvenience I have caused so far. Also, I haven't had the chance to thank you until now, but thank you for integrating nagisa
into konoha
!
This issue is resolved, so I close it. Thank you!
Hello @taishi-i, thank you for maintaining nagisa package! Let me report that I think we couldn't install nagisa with poetry. I'm not sure why but poetry tried to build DyNet even if the manifest explicitly requires Python 3.8+ (in this case, 3.10+).
Currently I have a workaround to specify the repository on GitHub so it's just to share with you. Maybe
switch_install_requires
doesn't work as expected. I'm sorry that currently I'm not sure which poetry or my config is bad.From PyPI
It (might) use sdist.
Full log: https://gist.github.com/himkt/f714d3c6a1f1e21f268a0ba5f4b7ee8b
From GitHub (git repo)
It uses dyNet38 as expected.