我正在关注https://github.com/jazzband/pip-tools#without-setuppy文档中的without setup.py
示例pip-tools
我所做的是我有这个作为我的requirements.in
# To update requirements.txt, run:
#
# pip-compile requirements.in
#
# To install in localhost, run:
#
# pip-sync requirements.txt
#
django==3.2.5 # https://www.djangoproject.com/
psycopg2-binary==2.8.6 # https://github.com/psycopg/psycopg2
然后我将其作为 prod-requirements.in
# To update prod-requirements.txt, run:
#
# pip-compile prod-requirements.in
#
# To install in prod, run:
#
# pip-sync requirements.txt prod-requirements.txt
#
-c requirements.txt
gunicorn==20.1.0 # https://github.com/benoitc/gunicorn
在我运行的生产中
$ pip-sync requirements.txt prod-requirements.txt
我的问题是如何强制执行最低 python 版本?我只想设置到次要的python版本。例如,我想要一种固定到 python 3.8 的方法。
我可以用 pip-tools 做到这一点吗?我需要选择 setup.py 方法吗?
我更喜欢只使用 requirements.in 方法,因为我最熟悉它