News for hackers. Stuff that matters.
Re:It’s OK for your open source library to be a bit shitty (... by DangitBobby on Saturday May 16, 2020 @11:46PM (#23209411)
I need to publish it publicly to install it via pip, npm, cargo, etc. for public use.
Re:It’s OK for your open source library to be a bit shitty (... by mroche on Sunday May 17, 2020 @12:28AM (#23209579)
Pip does not need a package to be public in order to install it at all, I’ve installed plenty of packages from tarballs and directories just fine. From the docs[0]

Install packages from:

- PyPI (and other indexes) using requirement specifiers.

- VCS project urls.

- Local project directories.

- Local or remote source archives.

Although I’m not quite sure how you’re using “for public use” in that sentence.

[0] https://pip.pypa.io/en/stable/reference/pip_install/#id19

Re:It’s OK for your open source library to be a bit shitty (... by DangitBobby on Sunday May 17, 2020 @01:51AM (#23209889)
I meant to say private use, not public use. But if I want to install from pip over the internet, which is my most common use case it needs to be publicly accessible, right? Which for me means GitHub, bitbucket, pypi, or some other bespoke solution just to avoid "publishing" something for my own private use. Or do I misunderstand?
Re:It’s OK for your open source library to be a bit shitty (... by lionyo on Sunday May 17, 2020 @04:46AM (#23210640)
You can publish to a local instance of PyPi

https://www.linode.com/docs/applications/project-management/...

Re:It’s OK for your open source library to be a bit shitty (... by DangitBobby on Sunday May 17, 2020 @05:31AM (#23210812)
I could do lots of things that would be unnecessarily burdensome for the dubious benefit of having my package unpublished. If it's acceptable to install it on a local network I can just do it directly from a normal filesystem.
Re:It’s OK for your open source library to be a bit shitty (... by JimDabell on Sunday May 17, 2020 @04:53AM (#23210658)
GitHub and Bitbucket have private repositories and you can install from those using pip. There's nothing forcing you to make something public.
Re:It’s OK for your open source library to be a bit shitty (... by DangitBobby on Sunday May 17, 2020 @05:37AM (#23210839)
I know about private repos. The hangup was installing from them. Last time I looked up how to have private python packages the the impression I got was "It's not possible." But now with a single Google search I see that it's very much possible (by using ssh). Not sure what changed other than two years have gone by.
Re:It’s OK for your open source library to be a bit shitty (... by sanderjd on Sunday May 17, 2020 @12:31AM (#23209591)
This is why I really liked the approach of using a github username as a namespace for rubygems, it lets you publish things but with some indication that it may just be for personal use.
Re:It’s OK for your open source library to be a bit shitty (... by traverseda on Sunday May 17, 2020 @04:29PM (#23215146)
I'm not sure having a hard dependency on github is a good idea, I think approaches like that are giving github/microsoft too much power.

Installing from a generic git URL tends to work just fine, even if it's a bit more typing.

Re:It’s OK for your open source library to be a bit shitty (... by sanderjd on Sunday May 17, 2020 @05:44PM (#23215786)
Yeah the useful thing is namespaces, I agree it would be good to not tie it to any given platform. I remember the cargo (rust) folks discussed including some way to have a namespace. I don't remember the details but I was disappointed they decided not to go that route.
Re:It’s OK for your open source library to be a bit shitty (... by sgillen on Sunday May 17, 2020 @12:58AM (#23209707)
I like that a lot! could work for personal python packages too.
Re:It’s OK for your open source library to be a bit shitty (... by DangitBobby on Sunday May 17, 2020 @02:00AM (#23209921)
You can install directly from GitHub, bitbucket, etc. with pip, BTW. My point was that if I want to have packages for private use installable over the internet with package management tools for various languages, I have to put them on the public internet, or jump through some hoops.
Re:It’s OK for your open source library to be a bit shitty (... by harikb on Sunday May 17, 2020 @02:23AM (#23210000)
Package management tools for both Rust and Go and JS do support direct github urls with minimal boilerplate. You have no reason to make something public unless you want to.
Re:It’s OK for your open source library to be a bit shitty (... by DangitBobby on Sunday May 17, 2020 @02:39AM (#23210076)
Oh you can use those tools with private repos?
Re:It’s OK for your open source library to be a bit shitty (... by BurpyDave on Sunday May 17, 2020 @04:17AM (#23210534)
You can for sure with go
Re:It’s OK for your open source library to be a bit shitty (... by steveklabnik on Sunday May 17, 2020 @09:16AM (#23211752)
You can with Rust as well.
Re:It’s OK for your open source library to be a bit shitty (... by sgillen on Wednesday May 27, 2020 @05:51PM (#23330518)
Totally, I already do that. Would be interesting to be able to install sgillen.package separately from package, with just a flag passed to pip.
Re:It’s OK for your open source library to be a bit shitty (... by acka on Sunday May 17, 2020 @08:46AM (#23211589)
Using pip, and possibly other tools, you can try using a .netrc[0] file to manage login credentials for private repositories. Although it is a cleartext file (so you may need to manage access to it, for instance when using it in CI), at least your credentials will not show up in log files.

[0] https://www.gnu.org/software/inetutils/manual/html_node/The-...

Re:It’s OK for your open source library to be a bit shitty (... by matheusmoreira on Sunday May 17, 2020 @02:53AM (#23210142)
I like this a lot. Publishing open source libraries and using them in private projects is a form of dogfooding.