Closed JOJ0 closed 4 months ago
I think you could close the other issue btw.
Sure you could go the other route as you state in the readme now that still bancamp-downloader needs to be executed right from the repo with ./bandcamp-downloader.py
, I still find the easiest way is when it gets installed with an entry point automatically. I think there would be some prerequisistes though. You would have to put the .py files together with an empty __init__.py
file into a subdirectory. That then makes it "a package", and from such a package the entry point, which is a function (often called main()
in a package, can be pulled (see the repo link I posted above. Some syntax with :
in it.
Anyway, back to your approch of keeping the .py file in the root of the repo:
Somehow the file bandcamp-downloader.py is not executable after I did a git pull. I see you aded the exec flag in one of your commits but it doesn't seem to work, at least on my end. Maybe you test again with a fresh repo and fresh venv.
Hope that helps at least a little.
Docs about entry points: https://packaging.python.org/en/latest/specifications/entry-points/#use-for-scripts
Hey @JOJ0 , I know it's been a while, but I took another look at this.
In all honesty, I don't like the idea of using entry_points
if it requires moving the base script into a subfolder. I don't like complicating running the thing any more than I have to for users that are not command line or tech savvy.
That said, I found that I can use a scripts
section and it seems to work just fine, at least in my test environment. It seems this isn't recommended over entry_points
for bigger or more complicated projects, but this isn't a bigger and more complicated project. (And I hope it never gets to be one.)
Do you want to give it a shot? It looks like if you do pip install [-e] .
that it adds bandcamp-downloader.py
to your path and things just work after that.
Closing this, as I think the request has been resolved. But if it hasn't then feel free to re-open it.
Hi, I finally found time to review your new setup.py
I think your setup.py is missing the part where it installs an actual cli wraper to the bin-path of the virtualenv / the env currently active / the user-env
An entry-points-part like this:
https://github.com/JOJ0/synadm/blob/2dbe0c62e25c6c293913fd1e7986ba1ccaf9ec22/setup.py#L59-L62
If you have that, usually
bandcamp-downloader
should be executable without the./
in front of it.