-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Root project not installed in editable mode #5265
Comments
I think maybe i know why editable no working. This module create .pth file to sites-packages to add local project directory to sys.path. try:
pth_file = self._env.site_packages.write_text(
pth_file, content, encoding="utf-8" # it use utf-8 for encoding
)
self._debug(
f" - Adding <c2>{pth_file.name}</c2> to <b>{pth_file.parent}</b> for"
f" {self._poetry.file.parent}"
)
return [pth_file] but it use utf-8 for encoding the .pth In Lib\site.py which for process the .pth file to add user path to sys.path. def addpackage(sitedir, name, known_paths):
"""Process a .pth file within the site-packages directory:
For each line in the file, either combine it with sitedir to a path
and add that to known_paths, or execute it if it starts with 'import '.
"""
if known_paths is None:
known_paths = _init_pathinfo()
reset = True
else:
reset = False
fullname = os.path.join(sitedir, name)
_trace(f"Processing .pth file: {fullname!r}")
try:
# locale encoding is not ideal especially on Windows. But we have used
# it for a long time. setuptools uses the locale encoding too.
f = io.TextIOWrapper(io.open_code(fullname), encoding="locale")
except IOError:
return It use 'local' to decode .pth file. |
@Badg It looks to me like your This is from a project of mine that installs the project under development in editable mode in
Does adding that |
@anthonymichaelclark I think you are looking for @Badg it might be related to package specification as the above comment alluded to. Can you share the directory structure of the project? You could also check what paths are being written into the |
I'm super busy at the moment, so I can't right now, but I'll try to get around to the above suggestions in the next few weeks! |
Update on this: I still haven't had a chance to try this again at work. However, I just encountered the same issue on my personal computer -- a win10 box -- running on the host OS (ie no docker) with python 3.9 (poetry latest version, running on py3.10). There, my pyproject.toml looks like this (lol on the project name) [tool.poetry]
name = "finfuck"
version = "0.0.1"
description = "Financial fucking bullshit"
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
# Currently pdftopng (camelot dep) has no wheels for 3.10
python = "~3.9"
forex-python = "^1.8"
alpha-vantage = "^2.3.1"
camelot-py = {extras = ["base"], version = "^0.10.1"}
[tool.poetry.dev-dependencies]
pytest = "^7.1.1"
ipython = "^8.2.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" @anthonymichaelclark @abn I tried adding both That being said, @kaluluosi 's comment about unicode definitely got my ears to perk up, because both my personal PC and my work computer have their system locale set to DE-DE. When I go to remove the file, I also see:
So it looks like the .pth is in fact being created. |
Closing as a specialized duplicate of #6091 as the only working reproductions are based on that root cause. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).Encountered on:
Gist of pyproject.toml and dockerfile here
Issue
I can't get my root project installed in editable mode. My understanding (from both docs and past usage) is that the root project should always be installed in editable mode, but both within a docker container and on the host, I'm unable to get it to do so. I've tried removing the build system from pyproject.toml on the off-chance that it might be related to #2956, but that didn't get me anywhere (I also noticed #1382, but I don't know how this would be related). I also tried manually specifying it as an editable install in dev dependencies using
develop = True
, but that errored out on an assertion, so I... well, I basically gave up pursuing that route because it's been a long day.Any thoughts? (PS: poetry is 🎉 😄 )
The text was updated successfully, but these errors were encountered: