Skip to content

Commit

Permalink
Add settings to be able to deploy to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
simw committed Nov 2, 2023
1 parent fe77d2e commit ac4c9ab
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 5 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
release:
types: [created]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: curl -sSL https://install.python-poetry.org | python - -y
- run: make lint

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python - -y
- run: poetry config virtualenvs.in-project true
- run: make test

deploy:
needs:
- test
- lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: curl -sSL https://install.python-poetry.org | python - -y

- name: check GITHUB_REF matches package version
uses: samuelcolvin/check-python-version@v3
with:
version_file_path: src/pydantic_to_pyarrow/__init__.py

- run: make package
- name: upload to pypi
run: poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.pypi_token }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lintable: prepare

.PHONY: lint
lint: prepare
poetry check
poetry run black --check --diff $(sources)
poetry run ruff check $(sources)
poetry run mypy $(sources)
Expand Down
27 changes: 24 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,31 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pydantic_to_pyarrow"
version = "0.0.1"
description = ""
authors = ["simw"]
version = "0.1"
description = "Conversion from pydantic models to pyarrow schemas"
authors = ["Simon Wicks <simw@users.noreply.github.com>"]
readme = "README.md"
repository = "https://github.com/simw/pydantic-to-pyarrow"
license = "MIT"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Operating System :: OS Independent",
"Environment :: Console",
"Environment :: MacOS X",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
packages = [{include = "pydantic_to_pyarrow", from = "src"}]

[tool.poetry.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/pydantic_to_pyarrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .schema import SchemaCreationError, get_pyarrow_schema

__version__ = "0.0.1"
__version__ = "0.1"

__all__ = [
"__version__",
Expand Down

0 comments on commit ac4c9ab

Please sign in to comment.