cherubicXN / hawp

Holistically-Attracted Wireframe Parsing [TPAMI'23] & [CVPR' 20]
MIT License
291 stars 51 forks source link

Need to uncomment a line in setup.py for pip install #38

Closed rpautrat closed 1 year ago

rpautrat commented 1 year ago

Hi,

Thank you again for the great work and for the latest updates of the HAWP models. This is a great work and is very useful for the community!

I just have a minor question regarding the setup.py file. The line https://github.com/cherubicXN/hawp/blob/f18f10e95a685abb1afc2a7b806c275da155a0a0/setup.py#L19 is currently commented out and prevents the package from being installed with pip. Running pip install -e . results in the following error for me:

error: Multiple top-level packages discovered in a flat-layout: ['hawp', 'docker', 'configs', 'weights', 'evaluation'].

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.

Uncommenting this line fixes the issue and allows the installation with pip. What is the reasoning behind commenting this line out? Would it be possible to uncomment it in the public repo? I can of course fork it and do the change myself, but some people might also benefit from it.

cherubicXN commented 1 year ago

Hi, thanks for your feedback!

Because the setup function requires to specify the packages, uncommenting the line will pass the following packages

>>> find_packages(exclude=("configs","tests"))
['hawp', 'evaluation', 'hawp.base', 'hawp.encoder', 'hawp.ssl', 'hawp.fsl', 'hawp.base.csrc', 'hawp.base.utils', 'hawp.ssl.config', 'hawp.ssl.misc', 'hawp.ssl.datasets', 'hawp.ssl.models', 'hawp.ssl.datasets.transforms', 'hawp.fsl.dataset', 'hawp.fsl.config', 'hawp.fsl.model', 'hawp.fsl.backbones', 'hawp.fsl.config.models', 'evaluation.sAPEval', 'evaluation.EdgeEval', 'evaluation.RasterizeLine']

which include hawp as a package, thus fixing the issues.

I have pushed the changes in this commit to fix this issue. You can try to pull the latest version.

Thanks again!

Nan

rpautrat commented 1 year ago

Perfect, thanks a lot Nan!