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

support for installing binary extension modules #3

Closed
etijskens opened this issue Oct 18, 2019 · 8 comments
Closed

support for installing binary extension modules #3

etijskens opened this issue Oct 18, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@etijskens
Copy link
Owner

etijskens commented Oct 18, 2019

lacking so far

@etijskens
Copy link
Owner Author

see
python-poetry/poetry#1351
python-poetry/poetry#1453
python-poetry/poetry#11

this relies on a (generated) setup.py which will eventually disappear...
this part of poetry is not ready yet.

let's instead go for local installation only, and just put a soft link in the current site-packages...

@etijskens
Copy link
Owner Author

a soft link to the package directory does not work, apparently.
must copy directory structure and soft links to files
copying build files is not nice. os.walk cannot selectively recurse directories? found walkdir at PyPI, (https://walkdir.readthedocs.io/en/stable/) which can exclude directories and files.
This is a workaround - but at least it works and continuous reinstallation (make reinstall) is not necessary. The only issue is:

pip uninstall et_dot
Uninstalling et-dot-0.0.0:
Would remove:
/Users/etijskens/miniconda3/envs/micctest/lib/python3.7/site-packages/et_dot-0.0.0.dist-info/*
/Users/etijskens/miniconda3/envs/micctest/lib/python3.7/site-packages/et_dot/*
Would not remove (might be manually added):
/Users/etijskens/miniconda3/envs/micctest/lib/python3.7/site-packages/et_dot/bar.cpython-37m-darwin.so
/Users/etijskens/miniconda3/envs/micctest/lib/python3.7/site-packages/et_dot/foo.cpython-37m-darwin.so
Proceed (y/n)?

implemented as micc dev-install

@etijskens
Copy link
Owner Author

etijskens commented Oct 23, 2019

[The workaround fails for CLIs installs in bin]
This is actually not true. For each CLI poetry installs a thin wrapper which imports the module for the CLI and executes the main function.
micc dev-uninstall, however, does not remove the wrapper.
E.g for micc the CLI executable is bin/micc but it is implemented in site-packages/micc/cli.py

@etijskens
Copy link
Owner Author

alternative: make install + copy/symlink of .so files

@etijskens
Copy link
Owner Author

this issue is kept open because there is only a temporary workaround awaiting poetry taking over installation

@etijskens etijskens added the enhancement New feature or request label Nov 8, 2019
@etijskens
Copy link
Owner Author

Since we decided dropping poetry for the time being, we got to implement setup.py.
here is the work plan:

  1. make sure pip install .and pip install -e . work
  2. publish and make sure that pip install works from pypi
  3. check what happens on windows and linux.

note that manifest.in has no effect on wheel.

@etijskens
Copy link
Owner Author

After some experimenting I found that pip install . builds a wheel that simply includes the .so files and installs them.
Probably, poetry will do so too.
The absence of a post install hook in poetry could be alleviated by implementing a pre-run hook in micc: check that the templates are unpacked from the archive.
Is that enough to pull me back to poetry?
still no editable install for poetry. (but we have already a workaround for that).
Apparently, pip reads the setup.py and the pyproject.toml

@etijskens
Copy link
Owner Author

now that micc-build is separated from micc, and binary extensions are always built locally, there is no need for publishing binary extensions. poetry 1.0.0b4 does very well now.

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

No branches or pull requests

1 participant