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

Using Poetry for building JupyterLab Prebuilt Extension #4013

Closed
igaloly opened this issue Apr 30, 2021 · 3 comments
Closed

Using Poetry for building JupyterLab Prebuilt Extension #4013

igaloly opened this issue Apr 30, 2021 · 3 comments
Labels
kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc)

Comments

@igaloly
Copy link

igaloly commented Apr 30, 2021

When I use JupyterLab's cookiecutter to create a new project and I build via setup.py,
when I'm installing the package, pip install . --upgrade, the some of the packages files are copied to share/jupyter/labextesions folder (the desired functionality)

BUT, when I'm using Poetry to build it, it seems like the after-install copy is not happening.
I've read that packages that were built with poetry DO NOT allow for arbitrary code execution after installation.

Is it the reason for the failure? IF NOT, I would like to get an explanation for that.

image

@abn
Copy link
Member

abn commented May 1, 2021

Wheels do not have a post install hook. See pypa/packaging-problems#64.

The reason why your setup tools build is working is most likely because of setup.py being executed at build time prior to install. Assuming sdist is what is being installed.

There could be two ways you could achieve similar results with poetry.

Option 1: This works for sdist only packages. You can add a build script that moves the files into the desired location. (Similar to setup tools scenario.)

Option 2: This might be a more universal option. You can include the files in the wheel, and add logic to move the files from the package directory to desired locations if they do not already exist within the root package's __init__.py.

@N-Coder N-Coder mentioned this issue Apr 5, 2022
2 tasks
@dimbleby
Copy link
Contributor

should be closed

@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc) labels Oct 29, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc)
Projects
None yet
Development

No branches or pull requests

4 participants