botamusique
botamusique copied to clipboard
Make botamusique installable via setuptools
Is your feature request related to a problem? Please describe.
I intend to upstream buildinstructions for botamusique in NixOS. Unfortunally botamusique has not setup.py
wich makes packaging it qute a bit of a challange. In the works of doing so, i actually created a setup.py
and turned botamusique from a module to a package and factored out the entrypoint into a class.
Describe the solution you'd like I was wandering if you would be interested in these patches. They are not perfect, as they do not touch the documentation nor package the webserver stuff but I would rather work on upstreaming these changes here, than maintaining about 500 lines of patches mostly fixing imports.
In doing so this would also make it easier to upstream botamusique to pypi.
Describe alternatives you've considered
Additional context Patchfile: https://git.c3pb.de/c3pb/phoenix/blob/master/pkgs/botamusique/setup.patch
AFAIK releases of this project are self-hosted by @azlux. He has all the files on his website and the installation can be done in one-line. So I'm not quite sure whether it is necessary to pack it with setuptools. @azlux should have more says on it.
Not sure it's a good idea. Botamusique isn't a module. I'm wonder how upgrade can be done. Pip isn't the best to auto upgrade.
I was thinking about an APT packages more than a pypi module. What do you think ? I'm curious @thelegy , what was the blocking step of the install ? Az
That being said, recently I was looking into setuptools, and I found pip can install package in "development" mode, which means it won't copy those files into site-packages directory and sometimes it can be useful. For example, pip has VCS support
pip install -e "vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"
if use git:
[-e] git://git.example.com/MyProject#egg=MyProject
[-e] git+http://git.example.com/MyProject#egg=MyProject
[-e] git+https://git.example.com/MyProject#egg=MyProject
[-e] git+ssh://git.example.com/MyProject#egg=MyProject
[-e] git+git://git.example.com/MyProject#egg=MyProject
[-e] git+file:///home/user/projects/MyProject#egg=MyProject
which can be found in https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support.
I think maybe this is a possible way at least for easier installation with the git version. Anyway, pip has its own advantage in dealing with dependencies. Maybe we can look into it a little bit and give it a shot.
And also, just out of curiosity, @thelegy packed this project with setup.py. Can you let us know more about your use case so we can learn from it? I also noticed that you didn't set include_package_data flag to True in your setup.py, which will result in all static files in templates/ and static/ not being packed and installed. Is that what you intended to do?
Thanks.
FWIW, here is a nix expression that gets botamusique working locally: http://ix.io/2k74
Save that as default.nix
and then nix-shell
should work to give a development environment. I'm using it currently on botamusique master.
NixOS does not require a setup.py, but it would make it easier to integrate with nixpkgs (and any other package repository, probably).
You might also consider using https://python-poetry.org.
I'd also like to have this, it would make packaging this for Gentoo a lot easier since I could just use the default python install methods and wouldn't have to write code to move the files around myself.
edit: I managed to get the ebuild working relatively reasonably with how it's currently set up, actually.