-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
develop mode does not respect src structure #230
Comments
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): This is a long-standing issue, originally reported as Distribute 177. If you read the background there, you'll see that the problem doesn't have an obvious general solution. Edit: Distribute 177 is here. |
Original comment by mgedmin (Bitbucket: mgedmin, GitHub: mgedmin): @marscher: your setup.py looks wrong. AFAIU it should say package_dir = { 'my_pkg' : 'src/my_pkg' } A simple workaround exists, as long as the package name matches the directory name: strip the last name from both sides of the mapping and use package_dir = { '' : 'src' } @jaraco: perhaps it'd be good to have 'python setup.py develop' fail with an error message instead of resulting in a broken I think it should be possible to solve this for all cases where the directory names in the source tree match package names, with a little bit of programming. (EDIT: updated @-mentions to use people's bitbucket usernames rather than first names. Sorry unrelated people who were probably pinged by mail, I didn't know that bitbucket actually parsed @-mentions in comments!) |
setuptools with develop does not support package_dir pypa/setuptools#230 This commit renames folder so that the very useful develop mode works out of the box.
setuptools with develop does not support package_dir pypa/setuptools#230 This commit renames folder so that the very useful develop mode works out of the box.
@RonnyPfannschmidt has suggested a few options:
All of these run into challenges thinking about the total workflow (how are they registered/uninstalled). If someone could put together a routine or package that demonstrates a technique for installing such a hook, then we can work to devise a workflow around it to use within the develop command and installers. |
i documented some of it in https://mail.python.org/pipermail/distutils-sig/2017-September/031498.html i made a prior implementation in https://github.com/RonnyPfannschmidt/gumby_elf/blob/03391bdf0cc66faaa2a5e034769e557c31974fd9/src/packing.py#L34-L43 i believe the best prospect is building/installing the dist info alongside a bootstrapped and a altered record file |
It is working with `setup.py install` and `pip install .`, but not with `setup.py develop` or `pip install -e .` See: pypa/pip#3160 pypa/setuptools#230
This is done to enable using `pip install -e .`, and to follow standard packaging rules. See: pypa/pip#3160 pypa/setuptools#230
* Move package requirements in setup.py for ease of installation * s/minatar_environment/minatar/, move environments into main package This is done to enable using `pip install -e .`, and to follow standard packaging rules. See: pypa/pip#3160 pypa/setuptools#230 * Update installation instructions in README.md * setup uses setuptools rather than disutils
This issue is explained here: pypa/setuptools#230
Annoyingly, there's a long outstanding bug in setuptools that prevents editable installs to work with python projects which use the src folder structure. pypa/setuptools#230 for now, just symlink to the module root to make it work.
So after reading https://bitbucket.org/tarek/distribute/issues/177#comment-4133779 and again reading pypa/setuptools#230 (comment) I realized the correct fix is this. And it only works, because the package name 'freemoovr' is equal to the folder 'src/freemoovr'. So setting package_dir in setuptools.setup() can work with `pip install -e` (or `python setup.py develop`) if you go from a mapping like: {'mypkg': 'subfolder/mypkg'} to {'': 'subfolder'} This works because the egg file and the easy-install.pth file will then correctly resolve to '/PATH-TO-SETUP-PY/subfolder'.
First, venvs are cool, so add them to the .gitignore. Second, if I do python3 setup.py develop, it doesn't work properly because of the package_dirs entry (see pypa/setuptools#230). So, rename the source directory to botbot so as to not need package_dirs (uglier in my opinion, but whatever). Third, use relative imports, because relative imports are cool (and because DRY).
- fixed `setup.py develop` using suggestion here: pypa/setuptools#230 (comment) - release GIL when calling SCIPsolve, SCIPpresolve, and SCIPfreeTransform to facilitate thread-level parallelism (e.g., from `joblib`) when solving batches of instances.
Hi there, Any updates on this? |
No updates, although the packaging standard have developed and now there is some standards for supporting editable installs. Perhaps supporting that PEP could open up opportunities for this use case. |
I believe v64.0.3+ solves the problem with |
This reverts commit dcb6ed2. Editable installs have been fixed as of setuptools v64.0.03 (pypa/setuptools#230) though this does require an up-to-date version of pip.
I'm sorry I tried setuptools 65.5.0 with python 3.10.9 with the case provided by OP and the problem still seems to exist. I ran |
Hi @gnaggnoyil please note that it is not possible to fix this problem if you are using If you want to give it a try to editable install, please use |
@abravalheri Hello, I also tried |
In this case, pip might be handling your project with the legacy procedure. You can try adding If that does not work. Please open a new issue with a minimal example that reproduces your error. |
Using the |
Originally reported by: marscher (Bitbucket: marscher, GitHub: marscher)
Assume you have project with a src folder:
in setup.py one have mapped the src folder, so it can be found during installation.
If one tries to install an egg link to the pkg via setup.py develop, this mapping is happily ignored. I'am not sure, if this is an issue either with setuptools or distutils. Symlinking my_pkg to the root fixes the problem.
The text was updated successfully, but these errors were encountered: