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

QUESTION: meta.yaml build:entry_points and setup.py entry_points #4291

Closed
johnflavin opened this issue Oct 1, 2021 · 2 comments
Closed

QUESTION: meta.yaml build:entry_points and setup.py entry_points #4291

johnflavin opened this issue Oct 1, 2021 · 2 comments
Labels
stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@johnflavin
Copy link

I have a question about an interaction between conda build and the underlying package build tool when both define an entry point. The purpose of defining the entry point is to create a minimal script that will pass CLI args into a python function. But which tool creates the script? conda-build or pip/setuptools/whatever packaging tool you're using? And in particular, how does the correct shebang in the final installed script get generated?

For a concrete example, I'm looking at metaflow. Its meta.yaml defines an entry_point, and its setup.py also defines the same entry point.

  1. When conda build is run, the source is downloaded and the build script {{ PYTHON }} -m pip install . -vv is run.
  2. I think that would create the entrypoint script.
  3. But then when conda build's post packaging step kicks in, what happens? Does it make a new entrypoint script based on the definition in meta.yaml? Does it leave the old one in place and modify its shebang line? Something else?
@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Jun 14, 2023
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Jul 15, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2023
@github-project-automation github-project-automation bot moved this to 🏁 Done in 🧭 Planning Jul 15, 2023
@LourensVeen
Copy link

For anyone else finding this, I have a similar setup and it appears that conda build overwrites the pip-created entrypoint script with its own. This is required, because pip will create an entrypoint script with a shebang line that hardcodes the location of the Python interpreter in the build environment. This environment is deleted once the package is built, leaving a broken script.

Conda creates one that has the usual #!/usr/bin/env python line, which will find the Python interpreter in the currently active Conda environment, which is exactly what you want if you've installed the package.

Debugging tip: Make sure your entry point is under build/entry_points, not under requirements/entry_points or requirements/build/entry_points. Tripped me up 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

2 participants