Skip to content
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

non-legacy namespace package #127

Merged
merged 2 commits into from
May 24, 2024

Conversation

bertsky
Copy link
Contributor

@bertsky bertsky commented May 23, 2024

The current legacy approach to namespace packaging does not work with development/editable installation. See OCR-D/ocrd_all#433

This PR fixes it for this package – analogous PRs to the other qurator repos will follow.

@vahidrezanezhad
Copy link
Member

@bertsky
This pr fails with the following error for stand-alone eynollah:

from qurator.eynollah.cli import main
ModuleNotFoundError: No module named 'qurator'

@bertsky
Copy link
Contributor Author

bertsky commented May 24, 2024

Indeed. I thought I had tested thoroughly. For the moment I'm puzzled.

@bertsky
Copy link
Contributor Author

bertsky commented May 24, 2024

The strangest thing of all is that these imports actually do work, but not in the entrypoint:

>>> from qurator.eynollah.cli import main
>>> main
<Command main>
python -c "from qurator.eynollah.cli import main; main()" --help
Usage: -c [OPTIONS]

Options:
  -i, --image FILE                image filename
  -o, --out DIRECTORY             directory to write output xml data
                                  [required]
  -di, --dir_in DIRECTORY         directory of images
...

@bertsky
Copy link
Contributor Author

bertsky commented May 24, 2024

ah, found it – will need to update the other PRs as well ...

@vahidrezanezhad vahidrezanezhad merged commit 721d3f7 into qurator-spk:main May 24, 2024
@vahidrezanezhad
Copy link
Member

@bertsky I believe we have made a mistake, and this PR should not be merged. The problem lies with the current setup file; eynollah still fails to find the qurator module. The reason for my initial justification is that if you have installed eynollah with a working setup file and then pull the new commits, you won't encounter the issue because the old installation has already created a correct SOURCES.txt file. However, if you delete the 'eynollah.egg-info' and 'build' directories and try to install eynollah with the latest setup file, you will encounter the problem.

@bertsky
Copy link
Contributor Author

bertsky commented Jun 27, 2024

I just tried afresh (new clone, new venv) from main.

With pip install -e . && python -c "import qurator.eynollah" it works.

With pip uninstall eynollah && pip install . && python -c "import qurator.eynollah" it also works.

eynollah still fails to find the qurator module

Perhaps you have some of the other packages in qurator namespace installed without merging my PR (at that respective repository) so you end up with a mix of old and new style namespace packages again?

@vahidrezanezhad
Copy link
Member

Yes you are right. With pip install -e . works. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants