错误
/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'
我的命名约定代码
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项目可能会根据特定项目的需要使用不同的版本控制方案,但是它们都必须符合PEP 440中指定的灵活的公共版本方案为了在工具和库中得到支持像
pip
和setuptools
。
PEP 440仅允许五个后缀:a
,b
,rc
,post
和dev
。
还请注意,a
和b
后缀标识Alpha和Beta版本,因此请检查您的版本控制方案是否反映了这一点(workbench
分支是否确实包含Alpha版本?]]
如果需要在版本中存储其他信息,则可以使用local version identifier分隔版本部分。范例:
1.2.3+spam 1.0.0.dev999+eggs123.bacon456
但是,再次重申PEP 440:
本地版本标识符在将上游项目发布到公共索引服务器时不应该使用,但是可以用来标识直接从项目源创建的私有版本。 [...]由于Python包索引仅用于索引和托管上游项目,因此它绝对不允许使用本地版本标识符。