The 0.7.0 release of miniver added support for allowing packages inside of a "src" directory.
While this makes miniver more flexible than before, the current implementation fails when the package is inside a directory with a different name.
When building a package that is part of a native namespace, your repository will look something like this:
In this scenario, producing a wheel file (by running python3 setup.py bdist_wheel) will fail because miniver's cmdclass (from _version.py) contains classes that make reference to ./some_package/_static_version.py (instead of ./some_namespace/some_package/_static_version.py).
This could be very easily solved if instead of having a dictionary cmdclass in _version.py, we have a function with a signature get_cmd(prefix_dir="") that can pre-pend any arbitrary directory to the classes contained in the dictionary.
With this proposed approach, in your setup.py you can call either:
module.get_cmdclass("some_namespace") when your distribution is part of a namespace
module.get_cmdclass("src") When your distribution is inside of a "src" directory
module.get_cmdclass() When your distribution is not part of either a namespace nor inside of a "src" directory
NOTE: Solving this problem is related to issue #38, and it's a pre-requisite to having a solution for that issue.
The 0.7.0 release of miniver added support for allowing packages inside of a "src" directory. While this makes miniver more flexible than before, the current implementation fails when the package is inside a directory with a different name.
When building a package that is part of a native namespace, your repository will look something like this:
In this scenario, producing a wheel file (by running
python3 setup.py bdist_wheel
) will fail because miniver'scmdclass
(from_version.py
) contains classes that make reference to./some_package/_static_version.py
(instead of./some_namespace/some_package/_static_version.py
).This could be very easily solved if instead of having a dictionary
cmdclass
in_version.py
, we have a function with a signatureget_cmd(prefix_dir="")
that can pre-pend any arbitrary directory to the classes contained in the dictionary. With this proposed approach, in yoursetup.py
you can call either:module.get_cmdclass("some_namespace")
when your distribution is part of a namespacemodule.get_cmdclass("src")
When your distribution is inside of a "src" directorymodule.get_cmdclass()
When your distribution is not part of either a namespace nor inside of a "src" directoryNOTE: Solving this problem is related to issue #38, and it's a pre-requisite to having a solution for that issue.