-
-
Notifications
You must be signed in to change notification settings - Fork 154
Update project dirs and files: introduce the pyproject.toml file with uv project manager.
#379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
82f8db0
8fc4799
f87e15a
7cf8d43
1002795
ecfcdaa
fd5c5c0
eedcca2
d2ab5e7
e396f61
f46065d
6984863
8494190
d8132cb
2377f91
c85e132
546eb19
08eb05f
e7df1e6
122d43e
48109bb
a036a45
3328d15
103dd32
b4f8421
6583a83
3774381
daf79af
27439a7
8e12fb9
0f1b7eb
1e679e5
3706f36
e6c2bbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,19 @@ | ||
| <!-- | ||
| Link to relevant issues or previous PRs, one per line. Use "fixes" to | ||
| automatically close an issue. | ||
| Link to relevant issue(s) or previous PR(s), one per line. Use "fixes" to automatically close the related issue. | ||
| --> | ||
|
|
||
| - fixes #<issue number> | ||
|
|
||
| <!-- | ||
| Ensure each step in CONTRIBUTING.rst is complete by adding an "x" to | ||
| each box below. | ||
| Ensure each step in the "CONTRIBUTING.rst" file is completed by adding an "x" inside each box below. | ||
|
|
||
| If only docs were changed, these aren't relevant and can be removed. | ||
| If only the documentation is changed, the checklist below may be removed. | ||
| --> | ||
|
|
||
| Checklist: | ||
|
|
||
| - [ ] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change. | ||
| - [ ] Add or update relevant docs, in the docs folder and in code. | ||
| - [ ] Ensure PR doesn't contain untouched code reformatting: spaces, etc. | ||
| - [ ] Run `flake8` and fix issues. | ||
| - [ ] Run `pytest` no tests failed. See https://clickhouse-sqlalchemy.readthedocs.io/en/latest/development.html. | ||
| - [ ] Add tests demonstrating the correct behavior of the change. All tests should pass. | ||
| - [ ] Add/Update relevant docs in the code and in the `docs` directory. | ||
| - [ ] Ensure the PR doesn't contain the code non-conformant with project formatting and linting rules. | ||
| - [ ] Run `ruff` and fix issues. | ||
| - [ ] Run `pytest` no tests failed. See the [development](https://clickhouse-sqlalchemy.readthedocs.io/en/latest/development.html) section. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,37 +28,45 @@ jobs: | |
| - 8123:8123 | ||
| - 9000:9000 | ||
|
|
||
| name: ${{ matrix.python-version }} CH=${{ matrix.clickhouse-version }} | ||
| name: "Py=${{ matrix.python-version }}; CH=${{ matrix.clickhouse-version }}" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| architecture: x64 | ||
|
|
||
| - name: Install the project | ||
| run: uv sync --python ${{ matrix.python-version }} --locked --all-extras --dev | ||
|
|
||
| # - name: Lint | ||
| # run: | | ||
| # uv run --python ${{ matrix.python-version }} ruff check | ||
| # uv run --python ${{ matrix.python-version }} ruff format --check | ||
|
Comment on lines
+44
to
+47
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR is large enough and if |
||
|
|
||
| - name: Install test requirements | ||
| run: | | ||
| pip install --upgrade pip setuptools wheel | ||
| pip install flake8 flake8-print coverage | ||
| python testsrequire.py | ||
| python setup.py develop | ||
| # Limit each test time execution. | ||
| pip install pytest-timeout | ||
| - name: Run flake8 | ||
| run: flake8 | ||
| uv pip install --python ${{ matrix.python-version }} pytest-timeout | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only this dependency is required, maybe move into the "pyproject.toml" and so be it and no need to dance with it here. |
||
|
|
||
| - name: Run tests | ||
| run: coverage run --source=clickhouse_sqlalchemy -m pytest --timeout=10 -v | ||
| timeout-minutes: 2 | ||
|
|
||
| - name: Set up Python for coverage submission | ||
| if: ${{ matrix.python-version == '2.7' }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.8 | ||
| architecture: x64 | ||
|
Comment on lines
59
to
63
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, is this necessary? This project does not support Python2.7, see the pyproject.toml and setup.py files. |
||
|
|
||
| - name: Install coveralls | ||
| run: | | ||
| # Newer coveralls do not work with github actions. | ||
| pip install 'coveralls<3.0.0' | ||
| uv pip install --python ${{ matrix.python-version }} "coveralls<3.0.0" | ||
|
|
||
| - name: Upload coverage | ||
| run: coveralls | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.7.9 | ||
stankudrow marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,11 @@ | ||
|
|
||
| from .ext.declarative import get_declarative_base | ||
| from .orm.session import make_session | ||
| from .sql import Table, MaterializedView, select | ||
|
|
||
|
|
||
| VERSION = (0, 3, 2) | ||
| __version__ = '.'.join(str(x) for x in VERSION) | ||
|
Comment on lines
-7
to
-8
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I have not found an easier and cheaper way for uv to use dynamic versioning. This solution - uv-dynamic-versioning - aims to retrieve data from a VCS. I tried this solution - setuptools-scm - yet it didn't work (an unexpected So, if you can find a better solution which allows the uv manager to support dynamic versioning in a cheap and an easy way, feel free to coautor and propose changes and even commits. |
||
|
|
||
|
|
||
| __all__ = ( | ||
| 'get_declarative_base', | ||
| 'make_session', | ||
| 'Table', 'MaterializedView', 'select' | ||
| "MaterializedView", | ||
| "Table", | ||
| "get_declarative_base", | ||
| "make_session", | ||
| "select", | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to specify this tedious
--python {version}flag because uv respects the ".python-version" file and can consult and activate the version specified in it.