Bug 1935266
| Summary: | RFE: Add option for namespace packages to %pyproject_save_files | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
| Component: | pyproject-rpm-macros | Assignee: | Miro Hrončok <mhroncok> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | rawhide | CC: | carl, code, davide, mhroncok, omosnacek, pviktori, python-sig, terryp |
| Target Milestone: | --- | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
This is on hold now until the situation wrt the semantics of %exclude is sorted out. Relevant thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/Y2W57QE7HFW5FEDAFMGUFOOL4JKE6N3F/#XOP2CNXLDNT5SRZ67DXPYRBXPLYCWUZ2 (search for my email with %exclude in it in case the anchor does nothing) An idea how to solve the namespace packages problem. Use (or generate):
%pycached %ghost %{python3_sitelib}/jaraco/__init__.py (if present)
%dir %{python3_site...}/jaraco
%dir %{python3_site...}/jaraco/__pycache__
That way, the individual packages don't conflict (%ghosts don't conflict and directories are co-owned) and don't need to manually require a filesystem package. And we can have __init__.py during %check.
Obviously, this only works when the package works on runtime without __init__.py which should be the case for namespace package from this decade.
(In reply to Miro Hrončok from comment #0) > Currently, this doesn't work: > > %pyproject_save_files jaraco.path > > It errors with: > > ValueError: Attempted to use a namespaced package with dot in the glob: > jaraco.path Not to self: `%pyproject_save_files jaraco/path` should fail with a similar message now. As should `%pyproject_save_files jaraco!path`, I guess. Does ! have any special meaning? Or do you mean any non-glob/non-identifier characters should do this? The idea with / is that I've seen people try it with slashes instead of dots, because the actual files are structured in that way and slash is a directory separator. No special meaning; I meant all non-glob/non-identifier characters. (In reply to Miro Hrončok from comment #4) > Not to self: `%pyproject_save_files jaraco/path` should fail with a similar > message now. pyproject-rpm-macros-0-47 added this. |
Currently, this doesn't work: %pyproject_save_files jaraco.path It errors with: ValueError: Attempted to use a namespaced package with dot in the glob: jaraco.path We could do something useful here instead or at least have an API for namespace packages. An idea I just had is: %pyproject_save_files -N jaraco Which would generate something like: %exclude %dir %{python3_site...}/jaraco %exclude %dir %{python3_site...}/jaraco/__pycache__ %pycached %exclude %{python3_site...}/jaraco/__init__.py %{python3_site...}/jaraco/* (actually expanded)