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

Add settings to be able to deploy to PyPI #7

Merged
merged 2 commits into from
Nov 2, 2023
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
69 changes: 69 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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

build:
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
- uses: actions/upload-artifact@v3
with:
path: dist/*
name: package

pypi-publish:
needs:
- build
name: upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: package
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
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