Skip to content

Commit 16c8947

Browse files
committed
style(pu): add PyPI related files
1 parent 8c876fd commit 16c8947

File tree

3 files changed

+200
-0
lines changed

3 files changed

+200
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.10'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install build twine
25+
26+
- name: Build package
27+
run: python -m build
28+
29+
- name: Check package
30+
run: twine check dist/*
31+
32+
- name: Publish to TestPyPI
33+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc')
34+
env:
35+
TWINE_USERNAME: __token__
36+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
37+
run: |
38+
twine upload --repository testpypi dist/*
39+
40+
- name: Publish to PyPI
41+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'rc')
42+
env:
43+
TWINE_USERNAME: __token__
44+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
45+
run: |
46+
twine upload dist/*
47+
48+
- name: Create GitHub Release
49+
uses: softprops/action-gh-release@v1
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
with:
52+
files: dist/*
53+
generate_release_notes: true
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

MANIFEST.in

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Include documentation files
2+
include README.md
3+
include README_zh.md
4+
include LICENSE
5+
include CHANGELOG.md
6+
7+
# Include requirements files
8+
include requirements.txt
9+
include requirements-dev.txt
10+
include requirements-doc.txt
11+
12+
# Include configuration files
13+
include Makefile
14+
include .pylintrc
15+
include .style.yapf
16+
17+
# Include documentation
18+
recursive-include docs *.rst *.md *.py *.txt
19+
20+
# Include assets
21+
recursive-include assets *.png *.jpg *.svg
22+
23+
# Include examples
24+
recursive-include examples *.py *.sh *.json *.yaml *.md
25+
26+
# Exclude unwanted files
27+
global-exclude __pycache__
28+
global-exclude *.py[cod]
29+
global-exclude *~
30+
global-exclude *.so
31+
global-exclude .DS_Store
32+
global-exclude .git*
33+
34+
# Exclude build and cache directories
35+
prune .git
36+
prune build
37+
prune dist
38+
prune *.egg-info
39+
prune __pycache__
40+
prune results
41+
prune rft_logs
42+
prune log
43+
prune wandb

pyproject.toml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "LightRFT"
7+
version = "0.1.0"
8+
description = "Light, Efficient, Omni-modal & Reward-model Driven Reinforcement Fine-Tuning Framework"
9+
readme = "README.md"
10+
requires-python = ">=3.10"
11+
license = {text = "Apache-2.0"}
12+
authors = [
13+
{name = "LightRFT Team", email = "opendilab@pjlab.org.cn"}
14+
]
15+
keywords = [
16+
"reinforcement learning",
17+
"RLVR",
18+
"RLHF",
19+
"large language models",
20+
"vision-language models",
21+
"reward models",
22+
"omni-modal",
23+
"multi-modal",
24+
"PPO",
25+
"GRPO",
26+
"deep learning",
27+
]
28+
classifiers = [
29+
"Development Status :: 4 - Beta",
30+
"Intended Audience :: Developers",
31+
"Intended Audience :: Science/Research",
32+
"License :: OSI Approved :: Apache Software License",
33+
"Programming Language :: Python :: 3",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
37+
"Topic :: Software Development :: Libraries :: Python Modules",
38+
]
39+
40+
dependencies = [
41+
"torch>=2.5.1",
42+
"transformers==4.51.3",
43+
"vllm==0.7.3",
44+
"sglang==0.4.5",
45+
"deepspeed>=0.15.0",
46+
"accelerate",
47+
"datasets",
48+
"wandb",
49+
"peft",
50+
"easydict",
51+
"decord",
52+
"orjson",
53+
"bitsandbytes",
54+
"einops",
55+
"loralib",
56+
"tensorboard",
57+
"tqdm",
58+
"nltk",
59+
"mathruler",
60+
"loguru",
61+
"librosa",
62+
]
63+
64+
[project.optional-dependencies]
65+
dev = [
66+
"pytest",
67+
"black",
68+
"pylint",
69+
"yapf",
70+
]
71+
docs = [
72+
"sphinx",
73+
"sphinx-rtd-theme",
74+
"sphinx-autobuild",
75+
]
76+
eval = [
77+
"latex2sympy2",
78+
"timeout_decorator",
79+
"word2number",
80+
]
81+
flash-attn = [
82+
"flash-attn",
83+
]
84+
85+
[project.urls]
86+
Homepage = "https://github.com/opendilab/LightRFT"
87+
Documentation = "https://github.com/opendilab/LightRFT/tree/main/docs"
88+
Repository = "https://github.com/opendilab/LightRFT"
89+
"Bug Reports" = "https://github.com/opendilab/LightRFT/issues"
90+
91+
[tool.setuptools]
92+
packages = ["lightrft"]
93+
94+
[tool.setuptools.package-data]
95+
lightrft = ["py.typed"]
96+
97+
[tool.black]
98+
line-length = 120
99+
target-version = ['py310', 'py311']
100+
101+
[tool.pylint.messages_control]
102+
max-line-length = 120

0 commit comments

Comments
 (0)