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.5.tar.gz (152.5 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.5.tar.gz.

File metadata

File hashes

Hashes for tencent_wedata_feature_engineering-0.1.50.5.tar.gz
Algorithm Hash digest
SHA256 6835f047a1abe48167fe577a8aa686596d58e3b4b4ea9aaab3fa7fa3b88018b9
MD5 e6578954e01f31ef4f28ffacfec280ba
BLAKE2b-256 e92a4214a3ff6060f1485ae2d8a978fec589d885ecdb85acf9dbfb6971192e13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tencent_wedata_feature_engineering-0.1.50.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8442b412d151cff98f1363c437cc0870dfc10372e2a1e9756f7c90fd68c751e8
MD5 b70261a14c207c1c8bb70a531e1e4692
BLAKE2b-256 1fb616cbf44934a8d98bb693938a8759c96b64902908d42b1e29b956c4afd230

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