We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Editable packages which generate *.pth files like this:
/workspaces/pms/serenity.base/src/python
work file, and the imports are shown. But if you have one more like this:
import __editable___serenity_analytics_1_0_0_finder; __editable___serenity_analytics_1_0_0_finder.install()
then you'll get errors regarding missing imports like this:
Import "serenity_analytics.validators.dataframe_validators" could not be resolved
In our case, it came about due to this pyproject.toml config, which mapped the package to two different directories:
pyproject.toml
[tool.setuptools.packages.find] where = ["src/python", "tests"] include = ["serenity_*"]
See above.
Both format pth files should be handled, and the module should resolve properly.
pth
NOTE: unit tests, etc. all work fine even though imports are not found, so they are valid.
Imports from such editable installs are incorrectly marked as missing.
I believe these are the relevant lines -- as you can see, the one package that has the different style of *.pth is not included in the list:
2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) Finding python search paths 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) Executing interpreter: '/workspaces/pms/serenity.middleware/.venv/bin/python' 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) Skipping '/usr/lib/python312.zip' because it is not a valid directory 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) Received 9 paths from interpreter 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) file:///usr/lib/python3.12 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) file:///usr/lib/python3.12/lib-dynload 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) file:///workspaces/pms/serenity.middleware/.venv/lib/python3.12/site-packages 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) file:///workspaces/pms/serenity.base/src/python 2024-12-24 21:14:37.118 [info] [Info - 9:14:37 PM] (2526) file:///workspaces/pms/serenity.base.services/src/python 2024-12-24 21:14:37.119 [info] [Info - 9:14:37 PM] (2526) file:///workspaces/pms/serenity.data.client/src/python 2024-12-24 21:14:37.119 [info] [Info - 9:14:37 PM] (2526) file:///workspaces/pms/serenity.middleware/src/python 2024-12-24 21:14:37.119 [info] [Info - 9:14:37 PM] (2526) file:///workspaces/pms/serenity.risk/src/python 2024-12-24 21:14:37.119 [info] [Info - 9:14:37 PM] (2526) file:///workspaces/pms/serenity.specifications/src/python
which is consistent with the output of:
python -c "import sys; print('\n'.join(sys.path))"
That suggests that maybe this way of enumerating the paths isn't sufficient?
The text was updated successfully, but these errors were encountered:
heejaechang
No branches or pull requests
Environment data
Code Snippet
Editable packages which generate *.pth files like this:
work file, and the imports are shown. But if you have one more like this:
then you'll get errors regarding missing imports like this:
In our case, it came about due to this
pyproject.toml
config, which mapped the package to two different directories:Repro Steps
See above.
Expected behavior
Both format
pth
files should be handled, and the module should resolve properly.NOTE: unit tests, etc. all work fine even though imports are not found, so they are valid.
Actual behavior
Imports from such editable installs are incorrectly marked as missing.
Logs
I believe these are the relevant lines -- as you can see, the one package that has the different style of *.pth is not included in the list:
which is consistent with the output of:
That suggests that maybe this way of enumerating the paths isn't sufficient?
The text was updated successfully, but these errors were encountered: