On Thu, Nov 14, 2019 at 6:03 AM Mo <burcheri.mass...@gmail.com> wrote:

> Am Donnerstag, 14. November 2019 11:55:54 UTC+1 schrieb RjOllos:
>
>>
>> $ pip install svn+https://trac-hacks.org/svn/accountmanagerplugin/trunk
>>
>> * Replace pip with pip2.7 as needed
>> * For Git repositories, use "git+" prefix rather than "svn+"
>>
>
> Thanks. But when installing from a custom link, for later updates I need
> to do another pip install -U from exactly the same link or does the
> installation remember it's source URI?
>

No, I don't think it remembers.

Instead, check-out/clone the repository and run "pip2 install ." from the
root of the repository (or you may be able to provide a path rather than
using "." from the root).


> Btw. all the updating via pip is not optimal. From what I learned on
> #python@freenode, pip has no 'pip update' and no 'pip update all' which
> every package manager should have a convenience function for. There is only
> pip2 install --user -U <pgklist>
> and
> pip2 list --user --outdated
> which I could use as input for the first.
> I could also maintain a <requirements file> but that would mean I need to
> maintain that for every new package.
>

Sure, but writing a requirements.txt that lists all of your installed
packages is not much work at all, in fact it will save you time.
"git+https" and "svn+https" URLs can be used in the requirements file. I
believe you can also use local paths to a repository checkout/clone (check
the docs on that).

Then, "pip2 install -Ur requirements.txt", and you never have to worry
about listing packages to update.

That gets you the same result as if the installation remembered its source
URI. And requirements.txt serves as documentation for your installed
packages.


> Finally after talking about these shortcomings on pip I was told, that
> "poetry (for projects) and pipx (for executables) are more suitable tools
> for end users", and that some " 'update all' is woefully ill-advised
> misfeature in library managers like pip and npm.
> I'm no Python dev yet and a bit confused about... so pip is more a library
> manager than a package manager...
>

pip is a package installer. It can update packages from PyPI and will
update to the latest version. When installing from a repository, I believe
it rebuilds the package every time - it may not be able to determine if the
installed version is the latest relative to the repository.

I haven't used poetry or pipx. There are all sorts of derivatives and
projects that build on pip that appear to provide minor conveniences.


> But still Trac advises to use pip if not doing the "python2.7 setup.py
> bdist_egg" manually.
>

Yes, pip is better than easy_install, as it installs in the newer wheel
format and has an "uninstall" feature. But you can use easy_install or
"python setup.py install" if you prefer.

The other issue is that plugins installed to the environment or shared
"plugins" directory must be eggs. I believe you may be able to force-build
an egg using pip, but by default it will install a wheel package. Wheel
packages are fine, and preferred, if installing to the global or virtual
environment.

The easiest thing to do in my opinion is:
* Write a requirements.txt
* Install from PyPI as much as possible. If a package isn't on PyPI or
needs to be updated on PyPI, just ask the author to publish it.
* Use a virtual environment. You can also delete the virtual environment
and recreate it with all plugins in seconds if you have a requirements.txt

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CA%2BBGpn9MrVXrShvWKTxFwRZwkenWJY%2BrNc1hZ9RcFGPVRiHoiQ%40mail.gmail.com.

Reply via email to