Skip to content

Commit

Permalink
chore: Use Poetry support for PEP 621
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jan 5, 2025
1 parent 5f477d9 commit 9526b90
Show file tree
Hide file tree
Showing 7 changed files with 454 additions and 357 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pip==24.3.1
poetry==1.8.5
poetry-dynamic-versioning==1.4.1
poetry==2.0.0
poetry-dynamic-versioning==1.5.0
poetry-plugin-export==1.8.0
nox==2024.10.9
nox-poetry==1.0.3
23 changes: 17 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,28 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
FORCE_COLOR: "1"

jobs:
test:
runs-on: ubuntu-latest
env:
FORCE_COLOR: "1"
NOXPYTHON: ${{ matrix.python-version }}
NOXFORCEPYTHON: ${{ matrix.python-version }}
NOXSESSION: tests
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
strategy:
fail-fast: false
max-parallel: 2
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"

steps:
- uses: actions/checkout@v4
Expand All @@ -64,6 +70,7 @@ jobs:
- name: Install Poetry
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
poetry --version
poetry self show plugins
Expand All @@ -82,14 +89,17 @@ jobs:
typing:
runs-on: ubuntu-latest
env:
NOXSESSION: mypy
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: "3.x"
cache: pip
cache-dependency-path: poetry.lock

Expand All @@ -100,16 +110,17 @@ jobs:
- name: Install Poetry
run: |
pipx install poetry
pipx install poetry --python ${{ steps.setup-python.outputs.python-path }}
pipx inject poetry poetry-plugin-export
poetry --version
poetry self show plugins
- name: Install Nox
run: |
pipx install nox
pipx install nox --python ${{ steps.setup-python.outputs.python-path }}
pipx inject nox nox-poetry
nox --version
- name: Run typing checks
run: |
nox --verbose -s mypy
nox --verbose
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ target/
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@session(python=python_versions)
def tests(session: Session) -> None:
"""Execute pytest tests."""
deps = ["pytest", "pytest-durations"]
deps = ["pytest"]
if "GITHUB_ACTIONS" in os.environ:
deps.append("pytest-github-actions-annotate-failures")

Expand Down
728 changes: 408 additions & 320 deletions poetry.lock

Large diffs are not rendered by default.

49 changes: 24 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
[build-system]
build-backend = "poetry_dynamic_versioning.backend"
requires = [
"poetry-core",
"poetry-core>=2,<3",
"poetry-dynamic-versioning",
]

[tool.poetry]
[project]
name = "tap-betterstack"
version = "0.0.0"
description = "`tap-betterstack` is a Singer tap for Better Stack, built with the Meltano SDK for Singer Taps."
authors = [
"Edgar Ramírez-Mondragón <[email protected]>",
readme = "README.md"
keywords = [
"Better Stack",
"ELT",
"singer.io",
]
license.file = "LICENSE"
authors = [ { name = "Edgar Ramírez-Mondragón", email = "[email protected]" } ]
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
keywords = [
"ELT",
"singer.io",
"Better Stack",
dynamic = [
"version",
]
license = "Apache-2.0"
readme = "README.md"
homepage = "https://github.com/edgarrmondragon/tap-betterstack"
repository = "https://github.com/edgarrmondragon/tap-betterstack"
documentation = "https://github.com/edgarrmondragon/tap-betterstack#readme"
dependencies = [
"singer-sdk~=0.42.1",
]
urls.Documentation = "https://github.com/edgarrmondragon/tap-betterstack#readme"
urls.Homepage = "https://github.com/edgarrmondragon/tap-betterstack"
urls.Repository = "https://github.com/edgarrmondragon/tap-betterstack"
scripts."tap-betterstack" = "tap_betterstack.tap:TapBetterStack.cli"

[tool.poetry.dependencies]
python = ">=3.9"
singer-sdk = "~=0.43.1"
[tool.poetry]
version = "0.0.0"

[tool.poetry.group.dev.dependencies]
mypy = ">=1.11.1"
Expand All @@ -41,10 +47,6 @@ singer-sdk = { version = "*", extras = [
] }
types-requests = "*"

[tool.poetry.scripts]
# CLI declaration
"tap-betterstack" = "tap_betterstack.tap:TapBetterStack.cli"

[tool.poetry-dynamic-versioning]
enable = true
format-jinja = """
Expand All @@ -61,8 +63,6 @@ style = "pep440"
vcs = "git"

[tool.ruff]
target-version = "py39"

line-length = 88
src = [
"tap_betterstack",
Expand All @@ -72,7 +72,6 @@ lint.select = [
"ALL",
]
lint.ignore = [
"ANN101", # missing-type-self
"COM812", # missing-trailing-comma
"DJ", # flake8-django
"FIX002", # line-contains-todo
Expand All @@ -99,7 +98,7 @@ lint.isort.required-imports = [
lint.pydocstyle.convention = "google"

[tool.pyproject-fmt]
max_supported_python = "3.13"
max_supported_python = "3.14"

[tool.pytest.ini_options]
addopts = "-vvv"
Expand Down

0 comments on commit 9526b90

Please sign in to comment.