Skip to content

Commit 2046cef

Browse files
authored
feat!: unify README handling across packages (#306)
* feat!: unify README handling across packages This commit standardizes the way README files are handled during builds and publishes across all packages. The main changes include: 1. Removing the need for separate README-PYPI.md files by using a more flexible approach 2. Updating the prepare_readme.py script to handle relative links more robustly 3. Simplifying the build and publish workflows by removing redundant steps 4. Adding tests for the README preparation functionality The changes make the build process more consistent across different packages and reduce duplication in the workflow files. The new approach also provides better handling of relative links in README files during package publication. BREAKING CHANGE: The way README files are prepared for publication has changed, which may affect custom build processes that relied on the previous approach. * ignore * chore: add linting for scripts directory This commit adds mypy, pyright, and ruff linting checks for the scripts directory to ensure code quality and consistency across the project. The changes include: - Adding mypy checks for the scripts directory - Adding pyright checks for the scripts directory - Adding ruff checks for the scripts directory This helps maintain consistent code quality standards across all parts of the codebase.
1 parent f77efc0 commit 2046cef

File tree

15 files changed

+156
-59
lines changed

15 files changed

+156
-59
lines changed

.genignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ pyproject.toml
22
examples/*
33
/utils/*
44
src/mistral/extra/*
5-
pylintrc
5+
pylintrc
6+
scripts/prepare_readme.py

.github/workflows/lint_custom_code.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626

2727
- name: Install dependencies
2828
run: |
29-
touch README-PYPI.md
3029
uv sync --all-extras
3130
3231
# The init, sdkhooks.py and types.py files in the _hooks folders are generated by Speakeasy hence the exclusion

.github/workflows/run_example_scripts.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
4040
- name: Build the package
4141
run: |
42-
touch README-PYPI.md # Create this file since the client is not built by Speakeasy
4342
uv build
4443
4544
- name: Install client with extras and run all examples.

.github/workflows/test_custom_code.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727

2828
- name: Install dependencies
2929
run: |
30-
touch README-PYPI.md
3130
uv sync --all-extras
3231
3332
- name: Run the 'src/mistralai/extra' package unit tests
3433
run: uv run python3.12 -m unittest discover -s src/mistralai/extra/tests -t src
34+
35+
- name: Run pytest for repository tests
36+
run: uv run pytest tests/

.github/workflows/update_speakeasy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838

3939
- name: Install dependencies
4040
run: |
41-
cp README.md README-PYPI.md
4241
uv sync --group dev --no-default-groups
4342
4443
- name: Install Speakeasy CLI

packages/mistralai_azure/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ requires = ["hatchling"]
4343
build-backend = "hatchling.build"
4444

4545
[tool.pytest.ini_options]
46-
asyncio_default_fixture_loop_scope = "function"
4746
pythonpath = ["src"]
4847

4948
[tool.mypy]
@@ -62,4 +61,3 @@ ignore_missing_imports = true
6261
[tool.pyright]
6362
venvPath = "."
6463
venv = ".venv"
65-

packages/mistralai_azure/scripts/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
export UV_PUBLISH_TOKEN=${PYPI_TOKEN}
44

5-
uv build
5+
uv run python ../../scripts/prepare_readme.py --repo-subdir packages/mistralai_azure -- uv build
66
uv publish

packages/mistralai_gcp/pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "1.6.0"
44
description = "Python Client SDK for the Mistral AI API in GCP."
55
authors = [{ name = "Mistral" }]
66
requires-python = ">=3.10"
7-
readme = "README-PYPI.md"
7+
readme = "README.md"
88
dependencies = [
99
"eval-type-backport >=0.2.0",
1010
"google-auth (>=2.31.0,<3.0.0)",
@@ -48,7 +48,6 @@ requires = ["hatchling"]
4848
build-backend = "hatchling.build"
4949

5050
[tool.pytest.ini_options]
51-
asyncio_default_fixture_loop_scope = "function"
5251
pythonpath = ["src"]
5352

5453
[tool.mypy]
@@ -65,4 +64,3 @@ ignore_missing_imports = true
6564
[tool.pyright]
6665
venvPath = "."
6766
venv = ".venv"
68-

packages/mistralai_gcp/scripts/prepare_readme.py

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

packages/mistralai_gcp/scripts/publish.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22

33
export UV_PUBLISH_TOKEN=${PYPI_TOKEN}
44

5-
uv run python scripts/prepare_readme.py
6-
7-
uv build
5+
uv run python ../../scripts/prepare_readme.py --repo-subdir packages/mistralai_gcp -- uv build
86
uv publish

0 commit comments

Comments
 (0)