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

Package discovery error with new setuptools #44

Open
kaitsull opened this issue Aug 23, 2023 · 2 comments
Open

Package discovery error with new setuptools #44

kaitsull opened this issue Aug 23, 2023 · 2 comments

Comments

@kaitsull
Copy link

Hi all!

When I try to download napari-lattice via:
pip install git+https://github.com/BioimageAnalysisCoreWEHI/napari_lattice.git

I receive the following error:

error: subprocess-exited-with-error  
    
  × Getting requirements to build wheel did not run successfully.  
  │ exit code: 1  
  ╰─> [14 lines of output]  
      error: Multiple top-level packages discovered in a flat-layout: ['core', 'plugin', 'notebooks', 'resources', 'sample_data', 'workflow_examples'].  
        
      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.

After perusing the internet I found that this error can be circumvented by either:

  1. This answer on stackoverflow suggested adding the following lines to the pyproject.toml:
[tool.setuptools]  
py-modules = []
  1. Since I don't have access to the repo, I tried downgrading setuptools via:
    pip install setuptools==version#

Unfortunately downgrading setuptools still causes a host of errors to occur. Any suggestions?

Thank you so much :octocat: !!!

@multimeric
Copy link
Collaborator

This is caused by the project being split into two Python packages. This affects only the case where you install directly from GitHub, so I would suggest using the standard PyPI version unless you need a specific change that's only on the Git master.

That said, you can still install from GitHub, using pip install git+https://github.com/BioimageAnalysisCoreWEHI/napari_lattice.git#subdirectory=core git+https://github.com/BioimageAnalysisCoreWEHI/napari_lattice.git#subdirectory=plugin. We will need to update our documentation about this.

@kaitsull
Copy link
Author

Wow thank you so so much for such a quick response!

This fix worked perfectly :)

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

2 participants