Skip to main content

Wedata Feature Engineering Library Development

Project description

Wedata Feature Engineering Library

Wedata 特征工程库,提供特征存储、特征管理等功能。

发布到 Test PyPI 完整流程

1. 注册 Test PyPI 账号并获取 Token

1.1 注册账号

  1. 访问 https://test.pypi.org/account/register/
  2. 填写用户名、邮箱、密码完成注册 colinshang Wedata@2022
  3. 验证邮箱 colinshang@tencent.com

1.2 创建 API Token

  1. 登录后访问 https://test.pypi.org/manage/account/
  2. 滚动到 API tokens 部分
  3. 点击 Add API token
  4. 填写 Token 名称(如 colin-api-token
  5. 选择 Scope(可选择整个账户或特定项目)
  6. 点击 Create token
  7. 立即复制并保存 Token(只显示一次,格式为 pypi-AgENdGVzdC5weXBpLm9yZwIkOTNmYmI3OTUtMmQ2YS00YWQxLWExOTQtYjM2N2FlNWM3MmRmAAIqWzMsIjBlZGUyZmY3LWJlMmYtNGRjNy1hOWZlLTQ5OTQ1OTdlZDJmMCJdAAAGIKkxZw9vxjNR5yy9w5ZelgvEP7fhHk_piJHFfjB3rIgc

1.3 配置本地凭证

创建或编辑 ~/.pypirc 文件:

[distutils]
index-servers =
    pypi
    testpypi

[pypi]
username = __token__
password = pypi-xxxxxxxxxxxxxxxx

[testpypi]
username = __token__
password = pypi-AgENdGVzdC5weXBpLm9yZwIkOTNmYmI3OTUtMmQ2YS00YWQxLWExOTQtYjM2N2FlNWM3MmRmAAIqWzMsIjBlZGUyZmY3LWJlMmYtNGRjNy1hOWZlLTQ5OTQ1OTdlZDJmMCJdAAAGIKkxZw9vxjNR5yy9w5ZelgvEP7fhHk_piJHFfjB3rIgc

注意:

  • username 固定为 __token__password 填写你的 API Token
  • 建议设置文件权限 chmod 600 ~/.pypirc

2. 项目配置

2.1 包名配置

setup.py 中配置包名:

#name="tencent_wedata_feature_engineering",      # 正式环境包名(已注释)
name="tencent_wedata_feature_engineering_dev",   # 测试环境包名(当前使用)

2.2 版本号配置

版本号在 wedata/__init__.py 中定义:

__version__ = "0.1.50"

3. 执行发布

3.1 发布到 Test PyPI(测试环境)

chmod +x build-test.sh
./build-test.sh

3.2 发布到 PyPI(正式环境)

chmod +x build.sh
./build.sh

3.3 脚本执行内容

发布脚本会执行以下操作:

  1. 清理旧的构建文件 (dist/, build/, *.egg-info/)
  2. 读取版本号(从 wedata/__init__.py
  3. 安装构建工具 (twine, build)
  4. 打包为 wheel 格式 (python3 setup.py sdist bdist_wheel)
  5. 上传到 PyPI/Test PyPI

4. 发布结果

发布成功后会显示:

View at:
https://test.pypi.org/project/tencent-wedata-feature-engineering-dev/0.1.50/

5. 安装使用

5.1 从 Test PyPI 安装

# 仅从 Test PyPI 安装
pip install -i https://test.pypi.org/simple/ tencent-wedata-feature-engineering-dev==0.1.50

# 如果有依赖在正式 PyPI 上,使用混合源安装
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ tencent-wedata-feature-engineering-dev==0.1.50

5.2 从正式 PyPI 安装

pip install tencent-wedata-feature-engineering

6. 相关文件说明

文件 用途
~/.pypirc PyPI 凭证配置
setup.py 包配置(名称、版本、依赖等)
wedata/__init__.py 版本号定义
build-test.sh 发布到 Test PyPI
build.sh 发布到正式 PyPI

7. 注意事项

  • Test PyPI 和正式 PyPI 是独立的仓库,需要分别注册账号和创建 Token
  • 同一版本号发布后无法覆盖,如需修改必须升级版本号
  • Test PyPI 仅用于测试,不应用于生产环境
  • ~/.pypirc 文件包含敏感信息,注意保护

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 Distribution

tencent_wedata_feature_engineering-0.1.50.4.tar.gz (152.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file tencent_wedata_feature_engineering-0.1.50.4.tar.gz.

File metadata

File hashes

Hashes for tencent_wedata_feature_engineering-0.1.50.4.tar.gz
Algorithm Hash digest
SHA256 aca54b06a698e6ce68053b1c3e162182f29bbd40134d87dfe22e51651f1bc26d
MD5 b6007a19acd4e597291849c438789646
BLAKE2b-256 fd6b3b2704e0d3865a5464239b1bb2d9c8da9c0f8ce618ca17532d04881d66b2

See more details on using hashes here.

File details

Details for the file tencent_wedata_feature_engineering-0.1.50.4-py3-none-any.whl.

File metadata

File hashes

Hashes for tencent_wedata_feature_engineering-0.1.50.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5328bf95b9e841f879c963169fa3a14ef7736a7bd188f3576bb887f93632077f
MD5 99bd85bfb85d18bcf2d8a24ac35efe10
BLAKE2b-256 3e6c1c563157f9e562a3a00f5201195416b9ab98cc60503e53c51769067b58e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page