Skip to content

Commit 4ca6dde

Browse files
build using uv
1 parent 0dc3f04 commit 4ca6dde

10 files changed

Lines changed: 1281 additions & 181 deletions

File tree

.coveragerc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/wf-pr-cov-comment.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,27 @@ jobs:
1414
python-version: ["3.12"]
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1820

19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v3
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
2123
with:
2224
python-version: ${{ matrix.python-version }}
2325

24-
- name: Upgrade pip
25-
run: python -m pip install --upgrade pip
26-
27-
- name: Install Tox
28-
run: pip install tox
29-
3026
- name: Run test
31-
run: tox -e test
32-
27+
run: |
28+
uv run --group test pytest \
29+
-vv \
30+
--timeout=120 \
31+
--junitxml=pytest.xml \
32+
--cov-config=pyproject.toml \
33+
--cov=src \
34+
--cov-report html:cov_html \
35+
--cov-report xml:cov.xml \
36+
--cov-fail-under=97
37+
3338
- name: Pytest coverage comment
3439
uses: MishaKav/pytest-coverage-comment@main
3540
with:

.github/workflows/wf-push.yml

Lines changed: 50 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,39 @@ jobs:
1111
python-version: ["3.11", "3.12", "3.13"]
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
1517

16-
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v3
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v6
1820
with:
1921
python-version: ${{ matrix.python-version }}
2022

21-
- name: Upgrade pip
22-
run: python -m pip install --upgrade pip
23-
24-
- name: Install Tox
25-
run: pip install tox
26-
2723
- name: Run lint
28-
run: tox -e lint
24+
run: uv run --group lint pylint --fail-under=10.0 "--ignore-patterns=.*egg-info.*,.*test.*" src/*
2925

3026
- name: Run test
31-
run: tox -e test
27+
run: |
28+
uv run --group test pytest \
29+
-vv \
30+
--timeout=120 \
31+
--junitxml=pytest.xml \
32+
--cov-config=pyproject.toml \
33+
--cov=src \
34+
--cov-report html:cov_html \
35+
--cov-report xml:cov.xml \
36+
--cov-fail-under=97
3237
3338
- name: Run build
34-
run: tox -e build
39+
run: uv build
3540

3641
- name: Build doc
37-
run: tox -e doc
42+
run: |
43+
cd docs
44+
uv run --group docs make html
45+
env:
46+
SPHINXBUILD: "python -m sphinx"
3847

3948
- name: Store the distribution packages
4049
uses: actions/upload-artifact@v5
@@ -50,10 +59,6 @@ jobs:
5059
needs:
5160
- build
5261
runs-on: ubuntu-latest
53-
strategy:
54-
fail-fast: false
55-
matrix:
56-
python-version: ["3.12"]
5762

5863
environment:
5964
name: github-pages
@@ -64,21 +69,21 @@ jobs:
6469
pages: write
6570

6671
steps:
67-
- uses: actions/checkout@v3
68-
69-
- name: Set up Python ${{ matrix.python-version }}
70-
uses: actions/setup-python@v3
72+
- uses: actions/checkout@v4
7173
with:
72-
python-version: ${{ matrix.python-version }}
73-
74-
- name: Upgrade pip
75-
run: python -m pip install --upgrade pip
74+
fetch-depth: 0
7675

77-
- name: Install Tox
78-
run: pip install tox
76+
- name: Install uv
77+
uses: astral-sh/setup-uv@v6
78+
with:
79+
python-version: "3.12"
7980

80-
- name: Run Doc
81-
run: tox -e doc
81+
- name: Build docs
82+
run: |
83+
cd docs
84+
uv run --group docs make html
85+
env:
86+
SPHINXBUILD: "python -m sphinx"
8287

8388
- name: Deploy to GitHub Pages
8489
uses: peaceiris/actions-gh-pages@v3
@@ -94,10 +99,6 @@ jobs:
9499
needs:
95100
- build
96101
runs-on: ubuntu-latest
97-
strategy:
98-
fail-fast: false
99-
matrix:
100-
python-version: ["3.12"]
101102

102103
environment:
103104
name: testpypi
@@ -107,21 +108,17 @@ jobs:
107108
id-token: write
108109

109110
steps:
110-
- uses: actions/checkout@v3
111-
112-
- name: Set up Python ${{ matrix.python-version }}
113-
uses: actions/setup-python@v3
111+
- uses: actions/checkout@v4
114112
with:
115-
python-version: ${{ matrix.python-version }}
116-
117-
- name: Upgrade pip
118-
run: python -m pip install --upgrade pip
113+
fetch-depth: 0
119114

120-
- name: Install Tox
121-
run: pip install tox
115+
- name: Install uv
116+
uses: astral-sh/setup-uv@v6
117+
with:
118+
python-version: "3.12"
122119

123-
- name: Run build
124-
run: tox -e build
120+
- name: Build package
121+
run: uv build
125122

126123
- name: Publish distribution 📦 to TestPyPI
127124
uses: pypa/gh-action-pypi-publish@release/v1
@@ -136,10 +133,6 @@ jobs:
136133
needs:
137134
- publish-to-testpypi # only publish to PyPI after TestPyPI publishing
138135
runs-on: ubuntu-latest
139-
strategy:
140-
fail-fast: false
141-
matrix:
142-
python-version: ["3.12"]
143136

144137
environment:
145138
name: pypi
@@ -149,21 +142,17 @@ jobs:
149142
id-token: write
150143

151144
steps:
152-
- uses: actions/checkout@v3
153-
154-
- name: Set up Python ${{ matrix.python-version }}
155-
uses: actions/setup-python@v3
145+
- uses: actions/checkout@v4
156146
with:
157-
python-version: ${{ matrix.python-version }}
147+
fetch-depth: 0
158148

159-
- name: Upgrade pip
160-
run: python -m pip install --upgrade pip
161-
162-
- name: Install Tox
163-
run: pip install tox
149+
- name: Install uv
150+
uses: astral-sh/setup-uv@v6
151+
with:
152+
python-version: "3.12"
164153

165-
- name: Run build
166-
run: tox -e build
154+
- name: Build package
155+
run: uv build
167156

168157
- name: Publish distribution 📦 to PyPI
169158
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ dmypy.json
152152
# Cython debug symbols
153153
cython_debug/
154154

155+
155156
# PyCharm
156157
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157158
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

MANIFEST.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,35 @@ dependencies = [
2424
dynamic = ["version"]
2525

2626
[project.scripts]
27-
nasdaq-ouch-codegen="nasdaq_protocols.ouch.codegen:generate"
28-
nasdaq-itch-codegen="nasdaq_protocols.itch.codegen:generate"
29-
nasdaq-sqf-codegen="nasdaq_protocols.sqf.codegen:generate"
30-
nasdaq-fix-codegen="nasdaq_protocols.fix.codegen:generate"
31-
nasdaq-asn1soup-codegen="nasdaq_protocols.asn1_app.codegen:generate_soup_app"
32-
nasdaq-protocols-create-new-project="nasdaq_protocols.tools.new_project:create"
33-
nasdaq-soup-tail="nasdaq_protocols.soup.tools_soup_tail:command"
27+
nasdaq-ouch-codegen = "nasdaq_protocols.ouch.codegen:generate"
28+
nasdaq-itch-codegen = "nasdaq_protocols.itch.codegen:generate"
29+
nasdaq-sqf-codegen = "nasdaq_protocols.sqf.codegen:generate"
30+
nasdaq-fix-codegen = "nasdaq_protocols.fix.codegen:generate"
31+
nasdaq-asn1soup-codegen = "nasdaq_protocols.asn1_app.codegen:generate_soup_app"
32+
nasdaq-protocols-create-new-project = "nasdaq_protocols.tools.new_project:create"
33+
nasdaq-soup-tail = "nasdaq_protocols.soup.tools_soup_tail:command"
34+
35+
36+
[dependency-groups]
37+
test = [
38+
"pytest>=8.3",
39+
"pytest-asyncio>=0.23",
40+
"pytest-cov>=4",
41+
"pytest-sugar",
42+
"pytest-timeout",
43+
]
44+
lint = [
45+
"pylint",
46+
"flake8",
47+
]
48+
docs = [
49+
"sphinx",
50+
]
51+
dev = [
52+
{ include-group = "test" },
53+
{ include-group = "lint" },
54+
{ include-group = "docs" },
55+
]
3456

3557

3658
[tool.setuptools_scm]
@@ -41,3 +63,49 @@ where = ["src"]
4163
include = ["nasdaq_protocols*"]
4264
namespaces = false
4365

66+
[tool.setuptools.package-data]
67+
"nasdaq_protocols" = ["**/*.mustache"]
68+
69+
70+
[tool.pytest.ini_options]
71+
pythonpath = ["src"]
72+
asyncio_mode = "auto"
73+
asyncio_default_fixture_loop_scope = "function"
74+
log_cli = true
75+
log_level = "INFO"
76+
log_format = "%(name)-20s: %(message)s"
77+
log_date_format = "%I:%M:%S"
78+
79+
80+
[tool.coverage.run]
81+
concurrency = ["multiprocessing"]
82+
parallel = true
83+
sigterm = true
84+
omit = [
85+
"src/nasdaq_protocols/tools/*",
86+
"src/nasdaq_protocols/soup/tools_soup_tail.py",
87+
"tests/*",
88+
]
89+
90+
91+
[tool.flake8]
92+
exclude = [
93+
".git",
94+
".tox",
95+
".venv",
96+
"venv",
97+
"__pycache__",
98+
"tests",
99+
"build",
100+
"dist",
101+
]
102+
max-complexity = 10
103+
max-line-length = 120
104+
per-file-ignores = [
105+
"./src/nasdaq_protocols/common/__init__.py:F401,F403",
106+
"./src/nasdaq_protocols/common/message/__init__.py:F401,F403",
107+
"./src/nasdaq_protocols/fix/__init__.py:F401,F403,F405",
108+
"./src/nasdaq_protocols/itch/__init__.py:F401,F403",
109+
"./src/nasdaq_protocols/fix/parser/__init__.py:F401,F403",
110+
]
111+

pytest.ini

Lines changed: 0 additions & 8 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)