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

Releasing sphinx-contrib packages using implicit namespace packages #11495

Closed
tjni opened this issue Jul 20, 2023 · 10 comments
Closed

Releasing sphinx-contrib packages using implicit namespace packages #11495

tjni opened this issue Jul 20, 2023 · 10 comments

Comments

@tjni
Copy link

tjni commented Jul 20, 2023

Is your feature request related to a problem? Please describe.

I am working on updating sphinx and sphinxcontrib packages in nixpkgs, which has its own quirks in its method for Python packaging. I don't fully understand why, but mixing packages that use setuptool's legacy namespace packages with those that use implicit namespace packages (e.g. sphinxcontrib-jquery, sphinxcontrib-applehelp) cause the latter to be considered missing when importing them.

I cannot reproduce this in a virtualenv, so it could be Nix specific, but it's also strange enough that I fear sinking tons of time into it if there's already a plan to migrate and release all the sphinxcontrib packages using either setuptools's or flit's support for implicit namespace packages. I am also willing to help with testing, PRs, or in any other way.

@AA-Turner
Copy link
Member

Are you able to reproduce this outwith Nix?

@tjni
Copy link
Author

tjni commented Jul 20, 2023

I have not been able to reproduce this yet outside of Nix, so please treat this as a feature request instead of a bug report.

@tjni
Copy link
Author

tjni commented Jul 21, 2023

I do have a lead on what's happening and, to make a long story short, it seems to be due to behavior from a *-nspkg.pth file that setuptools generates in its legacy namespace packages path. It doesn't quite work when different packages, some which contain these files and some which do not, are installed in disjoint directories (which nix does, unlike a virtualenv). If this is a bug, it is one in setuptools. If it is hard to fix, we will probably work around it in nixpkgs.

With that said, I still am interested in releases of the sphinxcontrib modules that migrate away from this legacy setuptools code path that could let us clean up any potential workarounds, and willing to help in any way.

@tjni
Copy link
Author

tjni commented Jul 21, 2023

In case it's interesting to you, I described this in more detail in pypa/setuptools#3991.

@tjni
Copy link
Author

tjni commented Aug 4, 2023

I have an approach to fix this in nixpkgs by post-processing some of these packages to delete those nspkg.pth files. I would like to gradually rely less and less on that over time. Would you be amenable if I worked on migrating to implicit namespaces?

@AA-Turner
Copy link
Member

Would you be amenable if I worked on migrating to implicit namespaces?

Yes, feel free to tag me.

A

@AA-Turner
Copy link
Member

AA-Turner commented Aug 7, 2023

I have just made a new release of each of the first party sphinxcontrib packages, though the PyPI uploads are currently prevented by pypa/trove-classifiers#150.

A

@tjni
Copy link
Author

tjni commented Aug 7, 2023

Thank you so much!

@tjni
Copy link
Author

tjni commented Aug 8, 2023

Thank you very much again for all your help. It's really tedious work, and I appreciate it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants