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

Installation error if nuclei localization was previously run #8

Open
pgarrison opened this issue Sep 6, 2024 · 1 comment
Open

Comments

@pgarrison
Copy link
Collaborator

Steps to reproduce

  1. Simulate a previous (partial) run of Nuclei_localization.py: mkdir -p emt_tmp/nuclei_localization
  2. Follow the virtual environment creation steps from the README.md:
    a. python -m venv venv
    b. source venv/bin/activate
    c. pip install -e .
    The final step produces this error:
Looking in indexes: https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/simple
Obtaining file:///home/philip.garrison/EMT_data_analysis
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      error: Multiple top-level packages discovered in a flat-layout: ['emt_tmp', 'EMT_data_analysis'].
      
      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.
      
      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:
      
      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names
      
      To find more information, look for "package discovery" on setuptools docs.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Version info

$ python --version && pip --version
Python 3.11.0
pip 24.2 from /home/philip.garrison/EMT_data_analysis/venv-pip/lib/python3.11/site-packages/pip (python 3.11)
@pgarrison
Copy link
Collaborator Author

pgarrison commented Sep 6, 2024

I believe this issue only happens if Nuclei_localization.py fails or is canceled in the middle. If it succeeds, I believe it will delete the emt_tmp directory.

One possible solution may be to use a tempfile.TemporaryDirectory() context manager instead of manually creating & deleting emt_tmp

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

No branches or pull requests

1 participant