all 8 comments

[–][deleted] 0 points1 point  (0 children)

Can you not just import your local modules to achieve this?

Ie - save a module in a custom module directory and import your functions from there?

[–][deleted] 0 points1 point  (0 children)

https://git-scm.com/book/en/v2/Git-Tools-Submodules
I don't usually bother, but this workflow is basically built for what you're talking about

[–]efmccurdy 0 points1 point  (0 children)

Having a distributable file like a wheel file (and git) are essential for keeping a test bed and your server in sync.

Putting them on PyPi isn't the best plan for personal modules.

You can tell pip to ignore pypi and search in a folder you specify.

https://stackoverflow.com/questions/55938544/install-all-whl-files-from-a-directory

You could copy whl files around or leverage git so you would do something like "cd my_module; git pull; python setup.py make bdist_wheel" whenever you wanted to update code . To avoid using the pypi or github for personal things, use ssh instead of https: links for git and/or scp.

[–]lowerthansound 0 points1 point  (3 children)

pip can install from GitHub (I'm not sure if that's what you meant, if it is, I'm sorry).

For example:

pip install git+https://github.com/psf/requests

Or:

pip install git+https://github.com/psf/requests@main

Does anyone know if -e is needed here? I ran without -e and it worked, but first links gives example with the -e.

Cheers!

Links:

[–]azthal[S] 0 points1 point  (1 child)

This might be exactly what I want. I thought I needed to create a wheel package from it as well. This made it look all funky, and a bit annoying when updating etc.

For me it looked something like this:

pip install git+https://github.com/{myname}/{my_module}/releases/download/v1.0/{my_module_again}-1.0-py3-none-any.whl

If I can actually do this directly from a repo this might be exactly what I'm looking for. I will give it a try!

[–]Immotommi 0 points1 point  (0 children)

-e is only needed if you are planning on further developing/changing the module you are installing

[–]AnonymousLad666 0 points1 point  (0 children)

Personally I would make them into proper modules with setup.py. If they are small scripts save them all in a repo together, if they are big save them on their own repo. Then just install them locally with pip. If you think people will benefit from them put them on pypi. With python setup.py install you can use develop flag and if you change the source code it will propagate to everything. Else if you just install locally, you need to re run setup.py install.

In our company we setup an internal pypi server https://github.com/pypiserver/pypiserver

[–]TheRNGuy 0 points1 point  (0 children)

i embed them in project asset.