Skip to content

Commit 96a6f2b

Browse files
committed
Cleanup dev setup
- Removes buildout; test_layer now fetches the crate package itself - Removes setup.py - Removes stale bin/test - Removes stale requirements.txt - Updates DEVELOP.rst - Removes poethepoet. Most python developers are familiar with `ruff`, `mypy` and `pytest`, no need to add an extra DSL on top that obfuscates what's being used. - Removes `bootstrap.sh`. `python -m venv` or `uv venv` are trivial enough and Python developers should be familiar with them.
1 parent e54841b commit 96a6f2b

File tree

9 files changed

+96
-370
lines changed

9 files changed

+96
-370
lines changed

DEVELOP.rst

Lines changed: 22 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,95 +5,49 @@ CrateDB Python developer guide
55
Setup
66
=====
77

8-
Optionally install Python package and project manager `uv`_,
9-
in order to significantly speed up the package installation::
10-
11-
{apt,brew,pip,zypper} install uv
12-
alias pip="uv pip"
13-
14-
To start things off, bootstrap the sandbox environment::
8+
Clone the repository::
159

1610
git clone https://github.com/crate/crate-python
1711
cd crate-python
18-
source bootstrap.sh
19-
20-
This command should automatically install all prerequisites for the development
21-
sandbox and drop you into the virtualenv, ready for invoking further commands.
22-
23-
24-
Running tests
25-
=============
26-
27-
All tests will be invoked using the Python interpreter that was used when
28-
creating the Python virtualenv. The test runner is `zope.testrunner`_.
29-
30-
Some examples are outlined below. In order to learn about more details,
31-
see, for example, `useful command-line options for zope-testrunner`_.
32-
33-
Run all tests::
3412

35-
poe test
13+
Setup a virtualenv and install the package::
3614

37-
Run specific tests::
15+
python -m venv .venv
16+
source .venv/bin/activate
17+
python -m pip install --group dev --group docs -e .
3818

39-
# Select modules.
40-
bin/test -t test_cursor
41-
bin/test -t client
42-
bin/test -t testing
19+
Or if using `uv`_::
4320

44-
# Select doctests.
45-
bin/test -t http.rst
21+
uv venv .venv
22+
source .venv/bin/activate
23+
uv pip install --group dev --group docs -e .
4624

47-
Ignore specific test directories::
4825

49-
bin/test --ignore_dir=testing
50-
51-
The ``LayerTest`` test cases have quite some overhead. Omitting them will save
52-
a few cycles (~70 seconds runtime)::
53-
54-
bin/test -t '!LayerTest'
55-
56-
Invoke all tests without integration tests (~10 seconds runtime)::
57-
58-
bin/test --layer '!crate.testing.layer.crate' --test '!LayerTest'
59-
60-
Yet ~60 test cases, but only ~1 second runtime::
26+
Running tests
27+
=============
6128

62-
bin/test --layer '!crate.testing.layer.crate' --test '!LayerTest' \
63-
-t '!test_client_threaded' -t '!test_no_retry_on_read_timeout' \
64-
-t '!test_wait_for_http' -t '!test_table_clustered_by'
29+
Ensure the virtualenv is active and run tests using `pytest`_::
6530

66-
To inspect the whole list of test cases, run::
31+
python -m pytest
6732

68-
bin/test --list-tests
6933

70-
The CI setup on GitHub Actions (GHA) provides a full test matrix covering
71-
relevant Python versions. You can invoke the software tests against a specific
72-
Python interpreter or multiple `Python versions`_ on your workstation using
73-
`uv`_, by supplying the ``--python`` command-line option, or by defining the
74-
`UV_PYTHON`_ environment variable prior to invoking ``source bootstrap.sh``.
34+
See also:
7535

76-
*Note*: Before running the tests, make sure to stop all CrateDB instances which
77-
are listening on the default CrateDB transport port to avoid side effects with
78-
the test layer.
36+
- `How to invoke pytest <https://docs.pytest.org/en/stable/how-to/usage.html>` for more information.
7937

8038

8139
Formatting and linting code
8240
===========================
8341

84-
To use Ruff for code formatting, according to the standards configured in
85-
``pyproject.toml``, use::
86-
87-
poe format
88-
89-
To lint the code base using Ruff and mypy, use::
42+
Use `ruff`_ for code formatting and linting::
9043

91-
poe lint
44+
ruff format --check .
45+
ruff check .
9246

93-
Linting and software testing, all together now::
9447

95-
poe check
48+
Use ``mypy`` for type checking::
9649

50+
mypy
9751

9852
Renew certificates
9953
==================
@@ -147,7 +101,7 @@ Writing documentation
147101

148102
The docs live under the ``docs`` directory.
149103

150-
The docs are written written with ReStructuredText_ and processed with Sphinx_.
104+
The docs are written with ReStructuredText_ and processed with Sphinx_.
151105

152106
Build the docs by running::
153107

@@ -171,4 +125,4 @@ nothing special you need to do to get the live docs to update.
171125
.. _uv: https://docs.astral.sh/uv/
172126
.. _UV_PYTHON: https://docs.astral.sh/uv/configuration/environment/#uv_python
173127
.. _versions hosted on ReadTheDocs: https://readthedocs.org/projects/crate-python/versions/
174-
.. _zope.testrunner: https://pypi.org/project/zope.testrunner/
128+
.. _pytest: https://docs.pytest.org/en/stable/

bin/test

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

bootstrap.sh

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

buildout.cfg

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

pyproject.toml

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["hatchling >= 1.26", "versioningit"]
2+
requires = ["hatch", "hatchling", "versioningit"]
33
build-backend = "hatchling.build"
44

55
[tool.hatch.build.targets.sdist]
@@ -26,7 +26,7 @@ name = "crate"
2626
dynamic = ["version"]
2727
description = "CrateDB Python Client"
2828
authors = [{ name = "Crate.io", email = "office@crate.io" }]
29-
requires-python = ">=3.10"
29+
requires-python = ">=3.6"
3030
readme = "README.rst"
3131
license = "Apache-2.0"
3232
classifiers = [
@@ -35,34 +35,45 @@ classifiers = [
3535
"Operating System :: OS Independent",
3636
"Programming Language :: Python",
3737
"Programming Language :: Python :: 3",
38+
"Programming Language :: Python :: 3.6",
39+
"Programming Language :: Python :: 3.7",
40+
"Programming Language :: Python :: 3.8",
41+
"Programming Language :: Python :: 3.9",
3842
"Programming Language :: Python :: 3.10",
3943
"Programming Language :: Python :: 3.11",
4044
"Programming Language :: Python :: 3.12",
4145
"Programming Language :: Python :: 3.13",
4246
"Programming Language :: Python :: 3.14",
4347
"Programming Language :: Python :: Implementation :: CPython",
4448
"Programming Language :: Python :: Implementation :: PyPy",
49+
"Programming Language :: SQL",
4550
"Topic :: Database",
51+
"Topic :: Internet :: WWW/HTTP",
52+
"Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator",
53+
"Topic :: System :: Networking",
4654
]
4755
dependencies = [
4856
"importlib-metadata; python_version<'3.8'",
49-
"orjson>=3.11.3",
57+
"orjson",
5058
"urllib3",
5159
"verlib2>=0.3.1",
5260
]
5361

5462
[dependency-groups]
5563
dev = [
56-
"certifi>=2025.10.5",
64+
"backports.zoneinfo<1; python_version<'3.9'",
65+
"certifi",
5766
"coverage<8",
5867
"mypy<1.20",
59-
"poethepoet<1",
6068
"pytest<10",
61-
"pytz>=2025.2",
69+
"pytz",
6270
"ruff<0.15",
63-
"setuptools>=80.9.0",
6471
"stopit<1.2",
6572
]
73+
docs = [
74+
"sphinx",
75+
"crate-docs-theme",
76+
]
6677

6778

6879
[tool.coverage.run]
@@ -185,37 +196,3 @@ lint.per-file-ignores."src/crate/client/{connection.py,http.py}" = [
185196
lint.per-file-ignores."tests/client/test_http.py" = [
186197
"A004", # Import `ConnectionError` is shadowing a Python builtin
187198
]
188-
189-
190-
# ===================
191-
# Tasks configuration
192-
# ===================
193-
194-
[tool.poe.tasks]
195-
196-
check = [
197-
"lint",
198-
"test",
199-
]
200-
201-
format = [
202-
{ cmd = "ruff format ." },
203-
# Configure Ruff not to auto-fix (remove!):
204-
# unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001).
205-
{ cmd = "ruff check --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 ." },
206-
]
207-
208-
lint = [
209-
{ cmd = "ruff format --check ." },
210-
{ cmd = "ruff check ." },
211-
{ cmd = "mypy" },
212-
]
213-
214-
test = [
215-
{ cmd = "coverage erase" },
216-
{ cmd = "coverage run -m pytest" },
217-
{ cmd = "coverage run bin/test" },
218-
{ cmd = "coverage combine" },
219-
{ cmd = "coverage xml" },
220-
{ cmd = "coverage report" },
221-
]

requirements.txt

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

0 commit comments

Comments
 (0)