A plugin that contains dynamic version numbers and default PyPI repository source settings.
Project description
README
相关资料
构建 whl 二进制包
Location: [PROJECT_ROOT]/.env
POETRY_VIRTUALENVS_IN_PROJECT=true
POETRY_PLUGIN_PRIVATE_DISABLE_LOG=true
POETRY_PYPI_MIRROR_URL=http://pypi.stone.cs/simple/
cd [PROJECT_ROOT]
make
安装插件
pip install poetry-plugin-private
修改 pyproject.toml 配置
新增以下内容即可支持读取 __version__
变量动态版本号
Location: <Env>:VERSION
or [Package]/__init__.py
:__version__
当 source = init
时,优先检测环境变量 VERSION
的值作为版本号。否则,从 [Package]/__init__.py
文件中读取 __version__
变量值作为版本号。
[tool.poetry-version-plugin]
source = "init"
Env: VERSION
[tool.poetry-version-plugin]
source = "env"
设置环境变量修改默认 PyPI 源地址
Linux
export POETRY_VIRTUALENVS_IN_PROJECT="true"
export POETRY_PYPI_MIRROR_DISABLE_CACHE="true"
export POETRY_PLUGIN_PRIVATE_DISABLE_LOG="true"
export POETRY_PYPI_MIRROR_URL="http://pypi.stone.cs/simple/"
Windows 10/11
[Environment]::SetEnvironmentVariable("POETRY_VIRTUALENVS_IN_PROJECT", "true", "User");
[Environment]::SetEnvironmentVariable("POETRY_PLUGIN_PRIVATE_DISABLE_LOG", "true", "User");
[Environment]::SetEnvironmentVariable("POETRY_PYPI_MIRROR_DISABLE_CACHE", "true", "User");
[Environment]::SetEnvironmentVariable("POETRY_PYPI_MIRROR_URL", "http://pypi.stone.cs/simple/", "User");
待支持的特性
- 支持环境变量
VERSION
动态设置 build 的版本号。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for poetry_plugin_private-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 281c1cd57519327d19a5457b0dfbd565d237b04fe00cc8420711de991d20806f |
|
MD5 | 8f4b7f7f82e8333c853924fc2cd5f53a |
|
BLAKE2b-256 | b94b59a281fafa9fe465db28e1e514513d0f617101eae44106b4886217f810d9 |