pingcap / django-tidb

TiDB dialect for Django
Apache License 2.0
30 stars 17 forks source link

Use compatible release clause `~=` defined at PEP 440 #65

Closed yahonda closed 1 day ago

yahonda commented 2 months ago

This pull request updates to Use compatible release clause ~= defined at PEP 440. I prefer this syntax to the current one.

How it works

% python -V
Python 3.12.3
% pip -V
pip 24.2 from /Users/yahonda@pingcap.com/Desktop/my-project/.venv/lib/python3.12/site-packages/pip (python 3.12)
% pip install 'django-tidb~=4.2.0'
Collecting django-tidb~=4.2.0
  Downloading django_tidb-4.2.4-py3-none-any.whl.metadata (9.0 kB)
Downloading django_tidb-4.2.4-py3-none-any.whl (23 kB)
Installing collected packages: django-tidb
  Attempting uninstall: django-tidb
    Found existing installation: django-tidb 5.0.0
    Uninstalling django-tidb-5.0.0:
      Successfully uninstalled django-tidb-5.0.0
Successfully installed django-tidb-4.2.4

Collecting django-tidb~=4.1.0 Downloading django_tidb-4.1.3-py3-none-any.whl.metadata (7.5 kB) Downloading django_tidb-4.1.3-py3-none-any.whl (24 kB) Installing collected packages: django-tidb Attempting uninstall: django-tidb Found existing installation: django-tidb 4.2.4 Uninstalling django-tidb-4.2.4: Successfully uninstalled django-tidb-4.2.4 Successfully installed django-tidb-4.1.3 %

- `pip install 'django-tidb~=3.2.0'` installs the latest patch version of django-tidb 4.1.z that is [3.2.3](https://github.com/pingcap/django-tidb/releases/tag/3.2.3)
```python
% pip install 'django-tidb~=3.2.0'
Collecting django-tidb~=3.2.0
  Downloading django_tidb-3.2.3-py3-none-any.whl.metadata (7.6 kB)
Downloading django_tidb-3.2.3-py3-none-any.whl (24 kB)
Installing collected packages: django-tidb
  Attempting uninstall: django-tidb
    Found existing installation: django-tidb 4.1.3
    Uninstalling django-tidb-4.1.3:
      Successfully uninstalled django-tidb-4.1.3
Successfully installed django-tidb-3.2.3
%

References

https://peps.python.org/pep-0440/#compatible-release