PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Thursday the 24th of October, 2019

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[07:49:06] <pombreda_> how would I specify in my setup that either one of this requirement or that requirement, at least one but not both should be installed?
[07:49:23] <pombreda_> (installed by default)
[11:02:51] <sjfhfeke> In my requirements.txt file there is such a line: git+git://github.com/CompanyName/ProjectName.git@master
[11:03:22] <sjfhfeke> Q1. If there is a commit to master to the target repo, will the dependency be automatically updated?
[11:04:17] <sjfhfeke> (i supposed it would, perheps erroneusly, because I was told the dependency was not updated and that I was supposed to update requirements.txt for the dependency to get autmatically updated)
[11:05:14] <sjfhfeke> Q2. The guy who wrote this line (not me) omitted #egg=ProjectName. But I was told that specifying #egg=ProjectName was required. What happens if this is omitted?
[11:10:11] <pombreda_> Q1. If there is a commit to master to the target repo, will the dependency be automatically updated? --> try it, but IMHO only if you pip install --upgrade and TBD
[11:12:37] <pombreda_> Q2. "What happens if this is omitted?" that's no longer needed nowadays. It will take the details from the setup.py
[11:12:45] <pombreda_> sjfhfeke: I hope this helps
[11:13:50] <pombreda_> re Q1. You need --upgrade to upgrade
[11:14:15] <pombreda_> so no, things will NOT get updated if there are new commits
[11:14:20] <pombreda_> unless you ask for --upgrade
[11:15:10] <sjfhfeke> just looked at the post-receive hook: `pip install -r requirements.txt` OK so I guess I have to explicitly specify the commit hash? If I explicitly specify the commit hash then pip install -r requirements.txt will update the dep?
[11:15:14] <sjfhfeke> (I hope)
[11:33:40] <pombreda_> sjfhfeke: not if you do not specify --upgrade
[11:44:24] <sjfhfeke> oops this sucks ;/
[11:47:10] <sjfhfeke> oh wait. Explicitly specifying the commit hash WHILE bumping version number in target repo's `setup.py` does seem to help: `pip install -r requirements.txt` finally updates the dep
[11:52:16] <sjfhfeke> no wait i dont even have to specify commit hash. @master is enough AS LONG AS I BUMP VERSION NUMBER in target repo's `setup.py`
[11:52:51] <sjfhfeke> there was the mistake: I forgot to bump version number in target repo's setup py
[12:41:50] <pombreda_> :)
[12:43:06] <pombreda_> or you could use some VCS-based versioning like I think there is setuptools_scm or what I use here: https://github.com/nexB/scancode-toolkit/blob/develop/setup.py#L38
[14:54:01] <sjhfeke> Is there any requirement for version numbers in `setup.py` and in release tags to be connected? I'm confused because according to Python docs version numbers in `setup.py` should be formed like `1.0` but git tags, afaik, typically look like `v1.0`. Pip can use both `setup.py` and tags to resolve dependency versions - are there any pitfalls here I
[14:54:01] <sjhfeke> can fall into?
[14:54:23] <ngoldbaum> no, there's no requirement
[14:54:46] <ngoldbaum> your version numbers should probably conform to the PEP about version numbers, otherwise pip or twine might normalize them
[14:54:55] <ngoldbaum> at least the version numbers in your setup.py
[14:55:04] <ngoldbaum> the ones in your git tags can be whatever you want them to be
[14:55:23] <ngoldbaum> https://www.python.org/dev/peps/pep-0440/
[14:56:57] <sjhfeke> yes but then i can write in `requirements.txt` something like `git+git://github.com/company/repo.git@v1.0` and this will correctly point to the tag regardless of `setup.py` version?
[14:57:58] <ngoldbaum> i think so but you should double-check me by trying it
[14:57:58] <sjhfeke> weird since `setup.py` version numbers do have a meaning for pip but OK - I guess its OK to do this and I'm not going to fall into any pitfalls
[14:57:58] <sjhfeke> ty
[14:58:10] <ngoldbaum> yeah, the version numbers have to be orderable by pip
[14:58:37] <ngoldbaum> pip didn't used to do that and so people uploaded versions to pypi that were impossible for pip to do anything about
[14:58:45] <ngoldbaum> thus the PEP
[14:59:53] <sjhfeke> yes and this confuses me: (a) pip takes into account both version numbers in `setup.py` AND in tags (b) but these don't have to match (c) oops looks like a receipt for failure unless I know the semantics of this perfectly well and unless I really know what I'm doing
[14:59:59] <sjhfeke> this at least is my thinking
[15:00:07] <ngoldbaum> no, pip doesn't take the ones in tags into account
[15:00:13] <ngoldbaum> it doesn't use those at all
[15:00:28] <sjhfeke> umm `git+git://github.com/company/repo.git@v1.0`
[15:00:31] <ngoldbaum> the use you referred to above would work for any arbitrary ref
[15:00:34] <ngoldbaum> tags aren't special
[15:02:30] <sjhfeke> ok ty