Skip to content
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

packaging: Pinned docs dependencies and use PEP 735 for them #2883

Merged
merged 7 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ jobs:

- name: Install dependencies
run: |
uv export --no-hashes --frozen --all-extras --group benchmark -o requirements.txt
uv pip install --system -r requirements.txt
uv pip install --system -r requirements/requirements.codspeed.txt
- uses: CodSpeedHQ/action@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ __pycache__/
*.so

# Distribution / packaging
requirements.txt
.Python
build/
develop-eggs/
Expand Down
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,55 @@ repos:
hooks:
- id: uv-lock
- id: uv-sync
- id: uv-export
name: Export docs requirements
args:
- "--no-emit-project"
- "--frozen"
- "--no-dev"
- "--group"
- "docs"
- "--output-file"
- "requirements/requirements.docs.txt"
- id: uv-export
name: Export package requirements, including extras
args:
- "--no-emit-project"
- "--frozen"
- "--all-extras"
- "--no-dev"
- "--output-file"
- "requirements/requirements.txt"
- id: uv-export
name: Export testing requirements
args:
- "--no-emit-project"
- "--frozen"
- "--only-group"
- "testing"
- "--output-file"
- "requirements/requirements.test.txt"
- id: uv-export
name: Export typing requirements
args:
- "--no-emit-project"
- "--frozen"
- "--only-group"
- "typing"
- "--output-file"
- "requirements/requirements.typing.txt"
- id: uv-export
name: Export Codspeed requirements
args:
- "--no-editable"
- "--frozen"
- "--no-hashes"
- "--no-dev"
- "--all-extras"
- "--group"
- "benchmark"
- "--output-file"
- "requirements/requirements.codspeed.txt"

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
Expand Down
4 changes: 1 addition & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ sphinx:

python:
install:
# - requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs
- requirements: requirements/requirements.docs.txt
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ de-facto open source standard for extract and load pipelines.
<a href="https://results.pre-commit.ci/latest/github/meltano/sdk/main">
<img alt="pre-commit.ci status" src="https://results.pre-commit.ci/badge/github/meltano/sdk/main.svg"/>
</a>
<a href="https://github.com/astral-sh/uv">
<img alt="uv" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json"/>
</a>
</div>

---
Expand Down
38 changes: 22 additions & 16 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
"test_cookiecutter",
]

dependency_groups = nox.project.load_toml()["dependency-groups"]
test_dependencies: list[str] = dependency_groups["dev"]
typing_dependencies: list[str] = dependency_groups["typing"]


@nox.session(python=main_python_version)
def mypy(session: nox.Session) -> None:
"""Check types with mypy."""
args = session.posargs or ["singer_sdk"]
session.install(".[faker,jwt,parquet,s3,testing]")
session.install(*typing_dependencies)
session.install(
".[faker,jwt,parquet,s3,testing]",
"-c",
"requirements/requirements.txt",
)
session.install("-r", "requirements/requirements.typing.txt")
session.run("mypy", *args)
if not session.posargs:
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")
Expand All @@ -65,8 +65,8 @@ def tests(session: nox.Session) -> None:
"s3",
]

session.install(f".[{','.join(extras)}]")
session.install(*test_dependencies)
session.install(f".[{','.join(extras)}]", "-c", "requirements/requirements.txt")
session.install("-r", "requirements/requirements.test.txt")

env = {"COVERAGE_CORE": "sysmon"} if session.python == "3.12" else {}

Expand All @@ -90,8 +90,8 @@ def tests(session: nox.Session) -> None:
@nox.session(python=main_python_version)
def benches(session: nox.Session) -> None:
"""Run benchmarks."""
session.install(".[jwt,s3]")
session.install(*test_dependencies)
session.install(".[jwt,s3]", "-c", "requirements/requirements.txt")
session.install("-r", "requirements/requirements.test.txt")
session.run(
"pytest",
"--benchmark-only",
Expand All @@ -103,7 +103,11 @@ def benches(session: nox.Session) -> None:
@nox.session(name="deps", python=main_python_version)
def dependencies(session: nox.Session) -> None:
"""Check issues with dependencies."""
session.install(".[docs,faker,jwt,parquet,s3,ssh,testing]")
session.install(
".[faker,jwt,parquet,s3,ssh,testing]",
"-c",
"requirements/requirements.txt",
)
session.install("deptry")
session.run("deptry", "singer_sdk", *session.posargs)

Expand All @@ -113,8 +117,8 @@ def update_snapshots(session: nox.Session) -> None:
"""Update pytest snapshots."""
args = session.posargs or ["-m", "snapshot"]

session.install(".[faker,jwt,parquet]")
session.install(*test_dependencies)
session.install(".[faker,jwt,parquet]", "-c", "requirements/requirements.txt")
session.install("-r", "requirements/requirements.test.txt")
session.run("pytest", "--snapshot-update", *args)


Expand All @@ -128,7 +132,7 @@ def doctest(session: nox.Session) -> None:
if "FORCE_COLOR" in os.environ:
args.append("--xdoctest-colored=1")

session.install(".")
session.install(".", "-c", "requirements/requirements.txt")
session.install("pytest", "xdoctest[colors]")
session.run("pytest", "--xdoctest", *args)

Expand All @@ -153,7 +157,8 @@ def docs(session: nox.Session) -> None:
if not session.posargs and "FORCE_COLOR" in os.environ:
args.insert(0, "--color")

session.install(".[docs]")
session.install(".", "-c", "requirements/requirements.txt")
session.install("-r", "requirements/requirements.docs.txt")

build_dir = Path("build")
if build_dir.exists():
Expand All @@ -175,7 +180,8 @@ def docs_serve(session: nox.Session) -> None:
"build",
"-W",
]
session.install(".[docs]", "sphinx-autobuild")
session.install(".", "-c", "requirements/requirements.txt")
session.install("-r", "requirements/requirements.docs.txt", "sphinx-autobuild")

build_dir = Path("build")
if build_dir.exists():
Expand Down
32 changes: 18 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,6 @@ dependencies = [
]

[project.optional-dependencies]
# Sphinx dependencies installed as optional 'docs' extras
# https://github.com/readthedocs/readthedocs.org/issues/4912#issuecomment-664002569
docs = [
"furo>=2024.5.6",
"myst-parser>=3",
"pytest>=7.2.1",
"sphinx>=7",
"sphinx-copybutton>=0.5.2",
"sphinx-inline-tabs>=2023.4.21",
"sphinx-notfound-page>=1.0.0",
"sphinx-reredirects>=0.1.5",
]

# File storage dependencies installed as optional 'filesystem' extras
s3 = [
"fs-s3fs>=1.1.1",
Expand Down Expand Up @@ -116,12 +103,28 @@ Documentation = "https://sdk.meltano.com/en/latest/"

[dependency-groups]
dev = [
"coverage[toml]>=7.4",
{"include-group" = "docs"},
{"include-group" = "testing"},
{"include-group" = "typing"},
"deptry>=0.15.0",
]
docs = [
"furo>=2024.5.6",
"myst-parser>=3",
"pytest>=7.2.1",
"sphinx>=7",
"sphinx-copybutton>=0.5.2",
"sphinx-inline-tabs>=2023.4.21",
"sphinx-notfound-page>=1.0.0",
"sphinx-reredirects>=0.1.5",
]
testing = [
"coverage[toml]>=7.4",
"duckdb>=0.8.0",
"duckdb-engine>=0.9.4; python_version<'4'",
"fastjsonschema>=2.19.1",
"moto>=5.0.14",
"pytest>=7.2.1",
"pytest-benchmark>=4.0.0",
"pytest-snapshot>=0.9.0",
"pytest-subtests>=0.13.1",
Expand All @@ -141,6 +144,7 @@ typing = [
"types-PyYAML>=6.0.12",
]
benchmark = [
{"include-group" = "testing"},
"pytest-codspeed>=2.2.0",
]

Expand Down
101 changes: 101 additions & 0 deletions requirements/requirements.codspeed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# This file was autogenerated by uv via the following command:
# uv export --no-editable --frozen --no-hashes --no-dev --all-extras --group benchmark --output-file requirements/requirements.codspeed.txt
.
aiobotocore==2.19.0
aiohappyeyeballs==2.4.6
aiohttp==3.11.12
aioitertools==0.12.0
aiosignal==1.3.2
appdirs==1.4.4
async-timeout==5.0.1 ; python_full_version < '3.11'
attrs==25.1.0
backoff==2.2.1 ; python_full_version < '4'
backports-datetime-fromisoformat==2.0.3 ; python_full_version < '3.11'
bcrypt==4.2.1
boto3==1.36.3
botocore==1.36.3
cattrs==24.1.2
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6 ; sys_platform == 'win32'
coverage==7.6.12
cryptography==44.0.1
duckdb==1.2.0
duckdb-engine==0.15.0 ; python_full_version < '4'
exceptiongroup==1.2.2 ; python_full_version < '3.11'
faker==36.1.1
fastjsonschema==2.21.1
frozenlist==1.5.0
fs==2.4.16
fs-s3fs==1.1.1
fsspec==2025.2.0
greenlet==3.1.1 ; (python_full_version < '3.14' and platform_machine == 'AMD64') or (python_full_version < '3.14' and platform_machine == 'WIN32') or (python_full_version < '3.14' and platform_machine == 'aarch64') or (python_full_version < '3.14' and platform_machine == 'amd64') or (python_full_version < '3.14' and platform_machine == 'ppc64le') or (python_full_version < '3.14' and platform_machine == 'win32') or (python_full_version < '3.14' and platform_machine == 'x86_64')
idna==3.10
importlib-metadata==8.6.1 ; python_full_version < '3.12'
importlib-resources==6.5.2 ; python_full_version < '3.10'
inflection==0.5.1
iniconfig==2.0.0
jinja2==3.1.5
jmespath==1.0.1
joblib==1.4.2
jsonpath-ng==1.7.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
markdown-it-py==3.0.0
markupsafe==3.0.2
mdurl==0.1.2
moto==5.0.28
multidict==6.1.0
numpy==2.0.2 ; python_full_version < '3.10'
numpy==2.2.3 ; python_full_version >= '3.10'
packaging==24.2
paramiko==3.5.1
platformdirs==4.3.6
pluggy==1.5.0
ply==3.11
propcache==0.2.1
py-cpuinfo==9.0.0
pyarrow==19.0.1
pycparser==2.22
pygments==2.19.1
pyjwt==2.10.1
pynacl==1.5.0
pytest==8.3.4
pytest-benchmark==5.1.0
pytest-codspeed==3.2.0
pytest-snapshot==0.9.0
pytest-subtests==0.14.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2025.1
pyyaml==6.0.2
referencing==0.36.2
requests==2.32.3
requests-cache==1.2.1
requests-mock==1.12.1
responses==0.25.6
rfc3339-validator==0.1.4
rich==13.9.4
rpds-py==0.22.3
s3fs==2025.2.0
s3transfer==0.11.2
setuptools==70.3.0
simpleeval==1.0.3
simplejson==3.20.1
six==1.17.0
sqlalchemy==2.0.38
time-machine==2.16.0
tomli==2.2.1 ; python_full_version <= '3.11'
typing-extensions==4.12.2
tzdata==2025.1
url-normalize==1.4.3
urllib3==1.26.20 ; python_full_version < '3.10'
urllib3==2.3.0 ; python_full_version >= '3.10'
werkzeug==3.1.3
wrapt==1.17.2
xdoctest==1.2.0
xmltodict==0.14.2
yarl==1.18.3
zipp==3.21.0 ; python_full_version < '3.12'
Loading
Loading