Skip to content
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

Installing Toqito #207

Closed
purva-thakre opened this issue Oct 25, 2023 · 7 comments · Fixed by #472
Closed

Installing Toqito #207

purva-thakre opened this issue Oct 25, 2023 · 7 comments · Fixed by #472
Assignees
Labels

Comments

@purva-thakre
Copy link
Collaborator

purva-thakre commented Oct 25, 2023

Based on the struggle in #204, need to figure out how an editable installation of toqito should be packaged.

Using pip install -e. did not install all the required packages. As this is a Python package and pip is popular, it would be good to figure this out especially where is pip getting the info from.

One option would be to use dev_requirements.txt created from a working installation via poetry. Then use pip install dev_reqs.

Last comment in the above linked issue talks about using poetry as a better dependency resolver. But if changes are made to pyproject.toml before using poetry lock (in toqito), poetry install, the newer version of pyproject.toml will not be used.

https://python-poetry.org/docs/faq/#why-is-the-dependency-resolution-process-slow
https://stackoverflow.com/a/73499097/10241324
https://stackoverflow.com/questions/58961497/how-to-update-poetrys-lock-file-without-upgrading-dependencies
https://stackoverflow.com/questions/58708936/pythonpoetry-installation-is-getting-stuck

Installing dependencies from lock file
Warning: poetry.lock is not consistent with pyproject.toml. You may be getting improper dependencies. Run `poetry lock [--no-update]` to fix it.

@purva-thakre
Copy link
Collaborator Author

Using pip install -e. did not install all the required packages.

this is probably related to versioning syntax. #218 (comment)

@purva-thakre
Copy link
Collaborator Author

purva-thakre commented Feb 13, 2024

A non-editable install of toqito is also causing issues with missing modules:

https://stackoverflow.com/questions/14295680/unable-to-import-a-module-that-is-definitely-installed

image

@vprusso
Copy link
Owner

vprusso commented Feb 13, 2024

Hmm. Wondering if we should just use a straight-up requirements.txt file instead of poetry as a possible solution.

I'm still not entirely sure I understand the problem in its entirety (that is, I understand the pain point, but I'm not sure what's causing it). Perhaps this is something we can chat about during our next sync, but if you have any insights, let's keep the conversation going here as this seems like a fairly serious one from a usability perspective.

@purva-thakre
Copy link
Collaborator Author

purva-thakre commented Feb 13, 2024

I understand the pain point, but I'm not sure what's causing it

Yeah, same here.

I thought pinning the versions in the toml file would fix it. It is weird though that only certain modules are inaccessible. toqito did install when I installed it via pip but trying to import some modules led to ModuleNotFoundError. Before it was due to toqito installing successfully but still causing issues with ModuleNotFoundError when toqito was imported.

I did find a previous discussion on this: pypa/pip#4810

Seems like something in setup.py is causing issues.

@vprusso
Copy link
Owner

vprusso commented Feb 14, 2024

Hmm, yeah so python setup.py sdist definitely seems to not include everything in the zip. Why that is is not quite clear to me, but it's definitely an issue of the sdist command not creating the files it should. Still looking into it, but that's likely part of the reason.

@vprusso
Copy link
Owner

vprusso commented Feb 14, 2024

So I think I know the problem. In setup.py we should include these lines:

    package_dir={"": "toqito"},
    packages=setuptools.find_packages(where="toqito"),

Doing so, and running the python setup.py sdist command does indeed generate the files in the generated zip that were previously missing. I'll make a PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants