Skip to content

Commit f1a510d

Browse files
committed
optimize pyproject
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
1 parent b221e2a commit f1a510d

3 files changed

Lines changed: 17 additions & 22 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@ jobs:
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
python -m pip install flake8 pytest build pytest_asyncio
35-
python -m build --wheel
3634
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
37-
pip install dist/*.whl
35+
pip install -e ".[test,build,yuanrong]"
3836
- name: Lint with flake8
3937
run: |
4038
# stop the build if there are Python syntax errors or undefined names
4139
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4240
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
4341
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42+
- name: Test Build
43+
run: |
44+
python -m build --wheel
4445
- name: Test with pytest
4546
run: |
4647
pytest

.github/workflows/sanity.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ jobs:
3838
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
3939
with:
4040
python-version: ${{ matrix.python-version }}
41-
- name: Install dependencies
42-
run: |
43-
python -m pip install --upgrade pip
44-
python -m pip install build
45-
python -m build --wheel
46-
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
47-
pip install dist/*.whl
4841
- name: Run license test
4942
run: |
5043
python3 tests/sanity/check_license.py --directories .

pyproject.toml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ pretty = true
7373
ignore_missing_imports = true
7474
explicit_package_bases = true
7575
follow_imports = "skip"
76-
77-
# Blanket silence
78-
ignore_errors = true
76+
ignore_errors = false
7977

8078
# -------------------------------
8179
# tool.pytest - pytest config
@@ -85,15 +83,6 @@ filterwarnings = [
8583
"ignore:.*PyTorch API of nested tensors.*prototype.*:UserWarning",
8684
]
8785

88-
[[tool.mypy.overrides]]
89-
module = [
90-
"transfer_queue.data_system.*",
91-
"transfer_queue.utils.utils.*",
92-
"transfer_queue.utils.zmq_utils.*",
93-
"transfer_queue.utils.serial_utils.*",
94-
]
95-
ignore_errors = false
96-
9786
# -------------------------------
9887
# tool.setuptools - Additional config
9988
# -------------------------------
@@ -108,11 +97,23 @@ version = {file = "transfer_queue/version/version"}
10897
dependencies = {file = "requirements.txt"}
10998

11099
[project.optional-dependencies]
100+
101+
build = [
102+
"build"
103+
]
104+
111105
test = [
112106
"pytest>=7.0.0",
113107
"pytest-asyncio>=0.20.0",
108+
"flake8",
109+
"pytest-mock",
114110
]
115111

112+
yuanrong = [
113+
"openyuanrong-datasystem"
114+
]
115+
116+
116117
# If you need to mimic `package_dir={'': '.'}`:
117118
[tool.setuptools.package-dir]
118119
"" = "."

0 commit comments

Comments
 (0)