Skip to content

Commit 5f9cada

Browse files
kesmit13claude
andauthored
Modernize the build and install system (#100)
* feature: Modernize the build and install system Migrated from setup.py/setup.cfg to pyproject.toml-based build system while maintaining all existing functionality including C extension builds. Created .flake8 configuration file and updated all utility scripts (bump_version.py, create_release.py) and documentation (RELEASE.md) to use pyproject.toml. Updated .pre-commit-config.yaml to use --py39-plus for reorder-python-imports and configured flake8 with min-python-version=3.9.0 to align with project's Python 3.9+ requirement. Removed obsolete setup-cfg-fmt hook. All build options, optional dependencies, entry points, and package metadata have been preserved. Tested with both editable install and wheel/sdist builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update requirements files * fix: Use table format for license field in pyproject.toml The newer string format for license (license = "Apache-2.0") requires setuptools >= 77.0.0. Changed to table format (license = {text = "Apache-2.0"}) to maintain compatibility with setuptools >= 61.0. Removed license-files field as setuptools automatically includes LICENSE file. * Update requirements paths * Remove pygeos requirement * Remove shapely requirement * Pin setuptools; eliminate C warnings * Pin setuptools; eliminate C warnings * Update dependency locations * Remove build isolation * Change metadata to boolean * Change metadata to int * Disable legacy cluster API --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ed3d311 commit 5f9cada

33 files changed

+203
-236
lines changed

.flake8

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[flake8]
2+
exclude =
3+
docs/*
4+
resources/*
5+
licenses/*
6+
max-complexity = 45
7+
max-line-length = 90
8+
min-python-version = 3.9.0
9+
per-file-ignores =
10+
singlestoredb/__init__.py:F401
11+
singlestoredb/fusion/__init__.py:F401
12+
singlestoredb/fusion/grammar.py:E501
13+
singlestoredb/http/__init__.py:F401
14+
singlestoredb/management/__init__.py:F401
15+
singlestoredb/mysql/__init__.py:F401

.github/workflows/code-check.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ jobs:
3939
- name: Install dependencies
4040
run: |
4141
python -m pip install --upgrade pip
42-
pip install -r requirements.txt
43-
pip install -r test-requirements.txt
44-
45-
- name: Install SingleStore package
46-
run: |
47-
pip install .
42+
pip install -e ".[dev]"
4843
4944
- name: Check for changes in monitored directories
5045
id: check-changes

.github/workflows/coverage.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@ jobs:
3333
- name: Install dependencies
3434
run: |
3535
python -m pip install --upgrade pip
36-
pip install -r requirements.txt
37-
pip install -r test-requirements.txt
38-
39-
- name: Install SingleStore package
40-
run: |
41-
pip install .
36+
pip install -e ".[dev]"
4237
4338
- name: Run MySQL protocol tests
4439
run: |

.github/workflows/fusion-docs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ jobs:
2727
run: |
2828
python --version
2929
python -m pip install --upgrade pip
30-
pip install -r requirements.txt
31-
32-
- name: Install package
33-
run: |
3430
pip install .
3531
3632
- name: Build Fusion docs

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: |
4040
python --version
4141
python -m pip install --upgrade pip
42-
pip install -r requirements.txt
42+
pip install .
4343
4444
- name: Initialize database
4545
id: initialize-database
@@ -78,8 +78,7 @@ jobs:
7878
- name: Install dependencies
7979
run: |
8080
python -m pip install --upgrade pip
81-
pip install -r requirements.txt
82-
pip install -r test-requirements.txt
81+
pip install -e ".[dev]"
8382
8483
- name: Build sdist
8584
if: runner.os == 'Linux'
@@ -211,7 +210,7 @@ jobs:
211210
run: |
212211
python --version
213212
python -m pip install --upgrade pip
214-
pip install -r requirements.txt
213+
pip install .
215214
216215
- name: Drop database
217216
if: ${{ always() }}

.github/workflows/smoke-test.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
python --version
2626
python -m pip install --upgrade pip
27-
pip install -r requirements.txt
27+
pip install .
2828
2929
- name: Initialize database
3030
id: initialize-database
@@ -111,12 +111,7 @@ jobs:
111111
- name: Install dependencies
112112
run: |
113113
python -m pip install --upgrade pip
114-
pip install -r requirements.txt
115-
pip install -r test-requirements.txt
116-
117-
- name: Install SingleStore package
118-
run: |
119-
pip install . --no-build-isolation
114+
pip install -e ".[dev]"
120115
121116
- name: Run tests
122117
if: ${{ matrix.driver != 'https' }}
@@ -151,7 +146,7 @@ jobs:
151146
run: |
152147
python --version
153148
python -m pip install --upgrade pip
154-
pip install -r requirements.txt
149+
pip install .
155150
156151
- name: Drop database
157152
if: ${{ always() }}

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,12 @@ repos:
2929
rev: v3.12.0
3030
hooks:
3131
- id: reorder-python-imports
32-
args: [--py36-plus]
32+
args: [--py39-plus]
3333
- repo: https://github.com/asottile/add-trailing-comma
3434
rev: v3.1.0
3535
hooks:
3636
- id: add-trailing-comma
3737
args: [--py36-plus]
38-
- repo: https://github.com/asottile/setup-cfg-fmt
39-
rev: v2.5.0
40-
hooks:
41-
- id: setup-cfg-fmt
4238
- repo: https://github.com/pre-commit/mirrors-mypy
4339
rev: v1.14.1
4440
hooks:

CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ pre-commit run --all-files
2727

2828
To create a test environment, do the following:
2929
```
30-
pip install -r requirements.txt
31-
pip install -r test-requirements.txt
30+
pip install -e ".[dev]"
31+
```
32+
33+
Or if you only need specific dependency groups:
34+
```
35+
pip install -e ".[test]" # Just testing dependencies
36+
pip install -e ".[docs]" # Just documentation dependencies
3237
```
3338

3439
If you have Docker installed, you can run the tests as follows. Note that

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resources/bump_version.py < major | minor | patch >
88
99
```
1010

11-
This will bump the version number in `setup.cfg` and `singlestoredb/__init__.py`
11+
This will bump the version number in `pyproject.toml` and `singlestoredb/__init__.py`
1212
using semantic versioning rules: minor bump for new features, patch bump for
1313
bug fixes. It will genarete a list of changes since the last version and
1414
ask for confirmation of the release notes in `docs/src/whatsnew.rst`.

accel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,11 +3079,11 @@ static PyObject *dump_rowdat_1_numpy(PyObject *self, PyObject *args, PyObject *k
30793079
PyErr_SetString(PyExc_ValueError, "value is outside the valid range for UNSIGNED INT"); \
30803080
goto error; \
30813081
}
3082-
#define CHECK_BIGINT(x, unsigned_input) if ((x) < ((unsigned_input) ? 0 : -9223372036854775808) || (x) > 9223372036854775807) { \
3082+
#define CHECK_BIGINT(x, unsigned_input) if ((x) < ((unsigned_input) ? 0 : INT64_MIN) || (x) > INT64_MAX) { \
30833083
PyErr_SetString(PyExc_ValueError, "value is outside the valid range for BIGINT"); \
30843084
goto error; \
30853085
}
3086-
#define CHECK_UNSIGNED_BIGINT(x, unsigned_input) if ((x) < 0 || (x) > 18446744073709551615) { \
3086+
#define CHECK_UNSIGNED_BIGINT(x, unsigned_input) if ((x) < 0) { \
30873087
PyErr_SetString(PyExc_ValueError, "value is outside the valid range for UNSIGNED BIGINT"); \
30883088
goto error; \
30893089
}

0 commit comments

Comments
 (0)