Skip to content
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
5 changes: 2 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN DEBIAN_FRONTEND=noninteractive \
libffi-dev \
liblzma-dev

# Python and poetry installation
# Python and uv installation
USER $USER
ARG HOME="/home/$USER"
ARG PYTHON_VERSION=3.9
Expand All @@ -41,5 +41,4 @@ RUN echo "done 0" \
&& echo "done 2" \
&& pyenv global ${PYTHON_VERSION} \
&& echo "done 3" \
&& curl -sSL https://install.python-poetry.org | python3 - \
&& poetry config virtualenvs.in-project true
&& curl -LsSf https://astral.sh/uv/install.sh | sh
17 changes: 8 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@ jobs:
with:
python-version: "3.9"

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install UV
uses: astral-sh/setup-uv@v3
with:
virtualenvs-create: true
virtualenvs-in-project: true
enable-cache: true

- name: Install dependencies
run: poetry install --only dev
run: uv sync

- name: Version Check and population of PROJECT_VERSION var
run: |
PROJECT_VERSION=$(poetry version --short)
PROJECT_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
TAG=$(git describe HEAD --tags --abbrev=0)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
echo "Project version: $PROJECT_VERSION"
Expand All @@ -62,9 +61,9 @@ jobs:
- name: Build sdist, wheel, and pex
run: >
mkdir -p dist
&& poetry export -E codegen --without dev --format requirements.txt --output dist/requirements.txt --without-hashes
&& poetry build
&& poetry run pex . --scie eager -o dist/asyncapi-python-codegen.pex -e asyncapi_python_codegen:app -r dist/requirements.txt
&& uv export --extra codegen --no-dev --format requirements-txt --output-file dist/requirements.txt --no-hashes
&& uv build
&& uv run pex . --scie eager -o dist/asyncapi-python-codegen.pex -e asyncapi_python_codegen:app -r dist/requirements.txt

- name: Upload wheel to Release
uses: actions/upload-release-asset@v1
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ jobs:
with:
python-version: ${{ matrix.python_version }}

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install UV
uses: astral-sh/setup-uv@v3
with:
virtualenvs-create: true
virtualenvs-in-project: true
enable-cache: true

- name: Install dependencies
run: poetry install --all-extras
run: uv sync --all-extras

- name: Run tests
env:
AMQP_URI: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
run: poetry run pytest
run: uv run pytest
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
### Project-specific ###
.vscode
poetry.lock

# Created by https://www.toptal.com/developers/gitignore/api/windows,linux,macos,vim,emacs,visualstudiocode,jetbrains+all,python
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,linux,macos,vim,emacs,visualstudiocode,jetbrains+all,python
Expand Down
72 changes: 32 additions & 40 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,59 +1,51 @@
[tool.poetry]
[project]
name = "asyncapi-python"
version = "0.2.5"
license = "Apache-2.0"
license = {text = "Apache-2.0"}
description = "Easily generate type-safe and async Python applications from AsyncAPI 3 specifications."
authors = ["Yaroslav Petrov <yaroslav.v.petrov@gmail.com>"]
authors = [{name = "Yaroslav Petrov", email = "yaroslav.v.petrov@gmail.com"}]
readme = "README.md"
packages = [
{ include = "asyncapi_python_pants", from = "src" },
{ include = "asyncapi_python_codegen", from = "src" },
{ include = "asyncapi_python", from = "src" },
requires-python = ">=3.9,<3.14"
dependencies = [
"pydantic>=2",
"pytz",
]

[tool.poetry.scripts]
asyncapi-python-codegen = "asyncapi_python_codegen:app"

[tool.poetry.extras]
[project.optional-dependencies]
codegen = [
"jinja2",
"typer",
"asyncapi_python_codegen",
"jinja2>=3.1.4",
"typer[all]>=0.12.5",
"pyyaml",
"datamodel-code-generator",
"datamodel-code-generator[http]>=0.26.4",
"black",
]
amqp = ["aio-pika"]

[tool.poetry.dependencies]
python = ">=3.9,<3.14"
pydantic = ">=2"
pytz = "*"
jinja2 = { version = "^3.1.4", optional = true }
typer = { extras = ["all"], version = "^0.12.5", optional = true }
datamodel-code-generator = { extras = [
"http",
], version = "^0.26.4", optional = true }
aio-pika = { version = "*", optional = true }
pyyaml = { version = "*", optional = true }
black = { version = "*", optional = true }
[project.scripts]
asyncapi-python-codegen = "asyncapi_python_codegen:app"

[tool.poetry.group.dev.dependencies]
black = "*"
mypy = "*"
isort = "*"
types-pyyaml = "*"
pytest = "*"
types-pytz = "*"
pytest-asyncio = "*"
pex = "*"
[tool.uv]
dev-dependencies = [
"black",
"mypy",
"isort",
"types-pyyaml",
"pytest",
"types-pytz",
"pytest-asyncio",
"pex",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry.requires-plugins]
poetry-plugin-export = ">=1.8"
[tool.hatch.build.targets.wheel]
packages = [
"src/asyncapi_python_pants",
"src/asyncapi_python_codegen",
"src/asyncapi_python",
]

[tool.pytest.ini_options]
asyncio_mode = "auto"
Expand Down
Loading