Skip to content

Commit

Permalink
Use uv instead of poetry, bump to py38
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Aug 27, 2024
1 parent 5669605 commit c1f26ae
Show file tree
Hide file tree
Showing 11 changed files with 429 additions and 356 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,31 @@ jobs:
strategy:
matrix:
version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
include:
- version: "3.11"
check-formatting: "true"
check-consistency: "true"
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
cache: "poetry"
- name: Install dependencies
allow-prereleases: true
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install the project
run: |
poetry install -n
- name: Install missing dependencies
run: |
poetry run pip install mypy
- name: Lint
run: |
poetry run pyright
poetry run ruff check
poetry run mypy awscrt-stubs
- name: Check formatting
if: ${{ matrix.check-formatting }}
run: |
poetry run ruff format --check
uv sync --all-extras --dev
- name: Run pre-commit
run: uv run pre-commit run --all-files
- name: Stubs consistency check
if: ${{ matrix.check-consistency }}
run: |
poetry run istub -d
uv run istub -d
27 changes: 12 additions & 15 deletions .github/workflows/publish_on_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
inputs:
force:
required: false
type: boolean
default: false
type: boolean
description: Force build even if consistency check fails (set to true)
version:
required: false
Expand Down Expand Up @@ -53,25 +53,22 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install -U poetry pip
poetry install -n
poetry run pip install -U twine
python-version: "3.12"
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install the project
run: uv sync --dev
- name: Install package
run: |
poetry run pip install ${PACKAGE}==${VERSION}
run: uv pip install ${PACKAGE}==${VERSION}
- name: Stubs consistency check
if: "${{ github.event.inputs.force != 'true' }}"
run: |
poetry run istub -d
uv run istub -d
- name: Bump version
run: |
echo "Bumping version to ${STUBS_VERSION}"
poetry version ${STUBS_VERSION}
rm -rf *.egg-info || true
poetry install -n
sed -i 's/^version = ".*"$/version = "'$STUBS_VERSION'"/' pyproject.toml
uv pip install .
- name: Commit changes
if: "${{ github.event.inputs.version == '' }}"
run: |
Expand All @@ -85,8 +82,8 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry build
poetry run twine upload --non-interactive dist/*
uvx --from build pyproject-build --installer uv
uvx twine upload --non-interactive dist/*
- name: Report status
uses: actions/github-script@v7
with:
Expand Down
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: local
hooks:
- id: lint
name: lint
language: system
pass_filenames: false
entry: uv run ruff check --fix
- id: format
name: format
language: system
pass_filenames: false
entry: uv run ruff format
- id: pyright
name: pyright
language: system
pass_filenames: false
entry: uv run pyright
- id: mypy
name: mypy
language: system
pass_filenames: false
entry: uv run mypy awscrt-stubs
5 changes: 1 addition & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"recommendations": [
"samuelcolvin.jinjahtml",
"tamasfe.even-better-toml",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.vscode-pylance",
"ms-python.flake8"
"charliermarsh.ruff"
]
}
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
awscrt-stubs/py.typed
awscrt-stubs/*.pyi
awscrt-stubs/*/*.pyi
269 changes: 0 additions & 269 deletions poetry.lock

This file was deleted.

2 changes: 0 additions & 2 deletions poetry.toml

This file was deleted.

70 changes: 29 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
[tool.black]
line-length = 100
include = '(awscrt-stubs)/.*\.pyi?$'
target-version = ['py37', 'py38', 'py39', 'py310']
preview = true

[tool.isort]
profile = "black"
line_length = 100
src_paths = []

[tool.poetry]
[project]
name = "types-awscrt"
version = "0.21.2"
requires-python = ">= 3.8"
description = "Type annotations and code completion for awscrt"
authors = ["Vlad Emelianov <vlad.emelianov.nz@gmail.com>"]
license = "MIT"
authors = [{ name = "Vlad Emelianov", email = "vlad.emelianov.nz@gmail.com" }]
license = { file = "LICENSE" }
readme = "README.md"
homepage = "https://youtype.github.io/mypy_boto3_builder/"
repository = "https://github.com/youtype/types-awscrt"
documentation = "https://youtype.github.io/mypy_boto3_builder/"
keywords = ["awscrt", "type-annotations", "pyright", "mypy", "boto3"]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -27,7 +14,6 @@ classifiers = [
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -39,31 +25,33 @@ classifiers = [
"Typing :: Stubs Only",
"Topic :: Software Development :: Libraries :: Python Modules",
]
packages = [{ include = "awscrt-stubs" }]
include = [
"awscrt-stubs/py.typed",
"awscrt-stubs/*.pyi",
"awscrt-stubs/*/*.pyi",
]

[tool.poetry.urls]
"Documentation" = "https://youtype.github.io/mypy_boto3_builder/"
"Source" = "https://github.com/youtype/types-awscrt"
"Bug Tracker" = "https://github.com/youtype/types-awscrt/issues"
[tool.uv]
config-settings = { editable-mode = "strict" }
dev-dependencies = [
"setuptools",
"pre-commit",
"awscrt",
"mypy",
"ruff",
"pyright",
"istub",
]

[tool.poetry.dependencies]
python = "^3.7"
[project.urls]
Homepage = "https://github.com/youtype/types-awscrt"
Documentation = "https://youtype.github.io/mypy_boto3_builder/"
Repository = "https://github.com/youtype/types-awscrt"
Changelog = "https://github.com/youtype/types-awscrt/releases"
Issues = "https://github.com/youtype/types-awscrt/issues"

[tool.poetry.dev-dependencies]
awscrt = "*"
pyright = "*"
ruff = "*"
mypy = { version = "*", python = ">=3.10" }
istub = { version = "*", python = ">=3.10" }

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ['setuptools']
build-backend = 'setuptools.build_meta'

[tool.setuptools]
packages = ["awscrt-stubs", "awscrt-stubs.eventstream"]

[tool.pyright]
include = ["awscrt-stubs"]
Expand All @@ -74,10 +62,10 @@ reportMissingTypeArgument = "error"
reportIncompatibleMethodOverride = "error"
reportIncompatibleVariableOverride = "error"
reportUnknownParameterType = "error"
pythonVersion = "3.7"
pythonVersion = "3.8"

[tool.mypy]
python_version = "3.7"
python_version = "3.8"
warn_return_any = false
warn_unused_ignores = false
warn_unused_configs = true
Expand All @@ -101,7 +89,7 @@ exclude = [

line-length = 100
indent-width = 4
target-version = "py37"
target-version = "py38"

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "B", "I", "N", "D", "C4", "C90", "RUF"]
Expand Down
7 changes: 2 additions & 5 deletions scripts/before_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ set -e
ROOT_PATH=$(dirname $(dirname $0))
cd $ROOT_PATH

poetry run pyright
poetry run ruff check
poetry run ruff format --check
poetry run mypy awscrt-stubs
poetry run istub -u
uv run pre-commit run --all-files
uv run istub -u
2 changes: 1 addition & 1 deletion scripts/open.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e

SITE_PACKAGES=`poetry run python -c "import sys; import os; paths = filter(lambda x: x.startswith(os.getcwd()), sys.path); print(list(paths)[0])"`
SITE_PACKAGES=`uv run python -c "import sys; import os; paths = filter(lambda x: x.startswith(os.getcwd()), sys.path); print(list(paths)[0])"`
echo "Site packages:" $SITE_PACKAGES
code $SITE_PACKAGES/awscrt
Loading

0 comments on commit c1f26ae

Please sign in to comment.