How to specify the "latest" version in Semver? - python-poetry

To date, I have been able to declare some packages as "latest" in my pyproject.toml
[tool.poetry.dependencies]
python = "3.9.*"
Authlib = "latest"
requests = "latest"
All is fine, until I upgrade to Poetry v1.2, whence it becomes not fine...
ParseConstraintError
Could not parse version constraint: latest
at ~/.asdf/installs/poetry/1.2.2/venv/lib/python3.9/site-packages/poetry/core/constraints/version/parser.py:147 in parse_single_constraint
143│ return version
144│
145│ from poetry.core.constraints.version.exceptions import ParseConstraintError
146│
→ 147│ raise ParseConstraintError(f"Could not parse version constraint: {constraint}")
Looking through PEP440 and Semver I can find no reference to indicate "latest" is actually a valid thing.
So, two questions:
Why does "latest" work in Poetry<1.2 but not >=1.2, or have I got this wrong?
Is there a semver symbol for "latest"? If so, what?
thx

"latest" has worked in Poetry < 1.2, because Poetry silently assume * for any invalid version constraint. Since 1.2 it throws an exception instead.
If you don't want to give any restriction to the version use *, which mean "any suitable version". If it's possible most dependency resolver like Poetry or pip will choose the latest version available then.

Related

TypeError: Updater.__init__() got an unexpected keyword argument 'use_context'

It occurred when I perform this :
updater = Updater('5502935975:AAGcE8wtPOUMXVCOI3PXr0fygpXsdaEn-HI', use_context=True)
Many Thanks!
You should revoke the token that you just posted. Also double check which version of python-telegram-bot you are using and followng the resources that PTB provides for that version.
Disclaimer: I'm currently the maintainer of python-telegram-bot.
"Down grade" or "upgrade" the python-telegram-bot to the relevant version , e.g i downgraded by using "pip install python-telegram-bot==13.7" from the lastest python-telegram-bot 20.0 version, and it worked for me,
NOTE: my version might be different from yours so use the right version that wont call the error

How do I specify a minimum package version in pipit setup.cfg

I am trying to specify a minimum package version in a pypi setup.cfg file. I have written this:
install_requires =
cocotb>=1.5.2
But I get this error message when I test my package installation:
ERROR: Could not find a version that satisfies the requirement cocotb>=1.5.2 (from pyuvm) (from versions: 1.0.20170128)
ERROR: No matching distribution found for cocotb>=1.5.2
It seems to be using the version number as part of the package name. When I install cocotb manually I see the correct version:
(clean) (base) raysalemi#RayProMac pyuvm % pip list
Package Version
---------- -------
cocotb 1.5.2
All the help I've seen on this refers to the setup.py file, but I am working with the setup.cfg file. What is the syntax to specify a module and version?
The syntax is correct. The problem was that cocotb 1.5.2 is not on test.pypi.org

Downgrading postgis 3.0.1 to 2.4.4

I tried searching for brew download formula for a spesific version of postgis, but could not find one.
I tried running following
ALTER EXTENSION postgis UPDATE TO "2.4.4";
It gives following error
ERROR: extension "postgis" has no update path from version "3.0.1" to version "2.4.4" SQL state: 22023
Any other possible way?
I don't know another way. As far as I know you have only the possibilities that are listed in the PostGIS-Folder of your Postgres-installation
e.g. C:\apps\PostgreSQL\13\share\extension
In my case with PostGIS 3.1.1 there are only Upgrade and no downgrade-options:
postgis--2.0.0--3.1.1.sql
postgis--2.0.1--3.1.1.sql
postgis--2.0.2--3.1.1.sql
...
postgis--3.1.0--3.1.1.sql

With composer, how to force the version of a package required from another one?

I would like to install a package ("Package 1") using composer.
But there is an incompatible version conflict : one of its dependencies ("Package 2") is incompatible with one of another package.
How could I force the installation of a package who requires an incompatible package version ("Package 2")?
Or How could I signify that the package 2 could have another version ?
This is the input and the output :
php composer require company1/package-name
.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: company2/package-name2[v5.8.0, v2.3.0].
Note : obviously, using a newer version of a package required by another one could cause some sort of instability/php problems in the overall website, but this is not an issue here

How do I setup the packages that are not in PYPI in requirements.txt for developing on Heroku?

I download a package from https://bitbucket.org/spirit/guess_language/downloads/guess_language-spirit-0.5a4.tar.bz2
now I'm going to deploy my app on Heroku and it tells me:
"Could not find a version that satisfies the requirement guess-language-spirit==0.5a4 (from app==1.0->-r /tmp/build_a92af1ad389e47ddc669f4154c077224/requirements.txt (line 1)) (from versions: 0.5a5, 0.5, 0.5.1, 0.5.2, 0.5.3)"
so how do I put this package into requirements.txt?
Try using:
https://bitbucket.org/spirit/guess_language/downloads/guess_language-spirit-0.5a4.tar.bz2#egg=guess-language-spirit-0.5a4
Usually that egg annotation is used for VCS systems rather than a tar file, but try anyway. See details about that in:
https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support

Resources