Skip to content

Commit 8aeddda

Browse files
bors[bot]sanders41
andauthored
Merge #704
704: Fix package build r=alallema a=sanders41 # Pull Request Reading through the Python [docs](https://packaging.python.org/en/latest/tutorials/packaging-projects/) on packaging and setuptools [docs](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html) I think I have pieced together everything need to make this work with `pyproject.toml` now. Running `python -m build` locally includes all the expected files and runs without error. ## Related issue Fixes #636 ## What does this PR do? - Removes the `setup.py` file - Updates the `pyproject.toml` file to include everything needed for build - Switch from `setup.py` to `build` ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Paul Sanders <[email protected]>
2 parents 585407c + a654d83 commit 8aeddda

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
pipenv install
24-
pipenv run pip3 install setuptools wheel twine
24+
pipenv run pip3 install build setuptools wheel twine
2525
- name: Build and publish
2626
env:
2727
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
2828
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2929
run: |
30-
pipenv run python3 setup.py sdist bdist_wheel
30+
pipenv run python3 -m build
3131
pipenv run twine upload dist/*

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- name: Install dependencies
8282
run: pipenv install --dev --python=${{ matrix.python-version }}
8383
- name: black
84-
run: pipenv run black meilisearch tests setup.py --check
84+
run: pipenv run black meilisearch tests --check
8585

8686
isort:
8787
name: isort

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[build-system]
22
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"
34

45
[project]
56
name = "meilisearch"
@@ -33,6 +34,13 @@ dynamic = ['version']
3334
[tool.setuptools.dynamic]
3435
version = {attr = "meilisearch.version.__version__"}
3536

37+
[tool.setuptools.packages.find]
38+
include = ["meilisearch*"]
39+
exclude = ["docs*", "tests*"]
40+
41+
[tool.setuptools.package-data]
42+
meilisearch = ["py.typed"]
43+
3644
[project.urls]
3745
Meilisearch_Documentation = "https://docs.meilisearch.com/"
3846
Documentation = "https://meilisearch.github.io/meilisearch-python/"
@@ -63,7 +71,7 @@ extend-exclude = '''
6371
[tool.isort]
6472
profile = "black"
6573
line_length = 100
66-
src_paths = ["meilisearch", "tests", "setup.py"]
74+
src_paths = ["meilisearch", "tests"]
6775

6876
[tool.mypy]
6977
disallow_untyped_defs = true

setup.py

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

0 commit comments

Comments
 (0)