Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abn/pycharm-namespace-package-issue
https://github.com/abn/pycharm-namespace-package-issue
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/abn/pycharm-namespace-package-issue
- Owner: abn
- Created: 2021-11-24T12:12:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-24T12:28:28.000Z (about 3 years ago)
- Last Synced: 2024-11-18T07:50:04.817Z (about 1 month ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reproducer for namespace package issue in PyCharm
### Steps to reproduce
Once you have cloned the repository you can set up the environment as follows.#### Initialise the virtual environment
```shell
# this ensures the virtual environment is created in the project directory
poetry config --local virtualenvs.in-project true
# this sets the environment up with all the required dependencies
poetry install
```#### Open the `namespace` project in PyCharm
Once opened do the following.1. Set the interpreter if not already detected (`namespace/.venv/bin/python`).
2. Mark `src` as source directory for the project.### Expected behaviour
The file at [`namespace/src/namespace/hello.py`](namespace/src/namespace/hello.py) should not have any inspection errors.### Actual behaviour
The file [`namespace/src/namespace/hello.py`](namespace/src/namespace/hello.py) has inspection errors, like shown here.```
Cannot find reference 'core' in '__init__.py'
```This is because PyCharm does not correctly detect `namespace-core` in the active environment when the `__init__.py` is
omitted in the `namespace-core` and a source directory is marked in `namespace`.