Python安装工具基于通用命名约定规范化版本名
错误 我的命名约定代码Python安装工具基于通用命名约定规范化版本名,python,python-3.x,setuptools,Python,Python 3.x,Setuptools,错误 我的命名约定代码 /root/.local/lib/python3.7/site-packages/setuptools/dist.py:476: UserWarning: Normalizing '2.1.0c1' to '2.1.0rc1' normalized_version, [Pipeline] sh + python3 -m twine upload --config-file .pypirc -r nesus dist/forecasting_model-2.1.0c1.
/root/.local/lib/python3.7/site-packages/setuptools/dist.py:476: UserWarning: Normalizing '2.1.0c1' to '2.1.0rc1'
normalized_version,
[Pipeline] sh
+ python3 -m twine upload --config-file .pypirc -r nesus dist/forecasting_model-2.1.0c1.tar.gz
InvalidDistribution: Cannot find file (or expand pattern): 'dist/forecasting_model-2.1.0c1.tar.gz'
我检查了这里的链接-
对于流行的命名约定
有没有办法修复这种感觉 您的版本方案与不兼容。你在问题中提到的链接明确指出: 不同的Python项目可能会根据特定项目的需要使用不同的版本控制方案,但是所有这些项目都需要遵守PEP 440中指定的灵活的公共版本方案,以便在
pip
和setuptools
等工具和库中得到支持
PEP 440只允许使用五个后缀:a
,b
,rc
,post
和dev
还要注意,a
和b
后缀标识alpha和beta版本,因此请检查您的版本控制方案是否反映了这一点(workbench
分支是否真的包含alpha版本?)
如果需要在版本中存储其他信息,可以使用来分隔版本部分。示例:
model_version_trunc = re.split("a|b|c", current_version)[0] if len(re.split("a|b|c", current_version)) > 0 else current_version
sub_version = int(re.split("a|b|c", current_version)[1]) if len(re.split("a|b|c", current_version)) > 1 else 1
VERSION = current_version
if BRANCH == 'workbench':
letter = 'a'
elif BRANCH == 'development':
letter = 'b'
elif BRANCH == 'master':
sub_version = ''
letter = ''
else:
letter = 'c'
VERSION = f'{model_version_trunc}{letter}{sub_version}'
# Check Version
session = HTMLSession()
r = session.get(MODEL_LIBRARY)
versions_so_far = r.html.links
version_already_exists = list(set([f'{VERSION}/']).intersection(versions_so_far))
logger.info(f'Updated Version: {VERSION}')
logger.info(f'Version Exists: {version_already_exists}')
if len(version_already_exists) > 0:
for x in version_already_exists:
'''
Fallback if versions are similar:
If a version is an alpha/beta/branch release, update the release number
If a version is just the standard version then udpate the minor version.
'''
但是,再次重申PEP 440:
将上游项目发布到公共索引服务器时,不应使用本地版本标识符,但可用于标识直接从项目源创建的私有生成。[…]由于Python包索引仅用于索引和托管上游项目,因此它不能允许使用本地版本标识符
1.2.3+spam
1.0.0.dev999+eggs123.bacon456