Skip to content

Commit 1c2187a

Browse files
committed
Project simplification
1 parent 3a705c7 commit 1c2187a

27 files changed

+769
-1076
lines changed

.editorconfig

Lines changed: 0 additions & 11 deletions
This file was deleted.

.flake8

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/release-package.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
1-
# Copyright 2022 J.P. Morgan Chase & Co.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4-
# the License. You may obtain a copy of the License at
5-
#
6-
# http://www.apache.org/licenses/LICENSE-2.0
7-
#
8-
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
9-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10-
# specific language governing permissions and limitations under the License.
11-
12-
# This workflow will upload a Python Package using Twine when a release is created
13-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
14-
151
name: Upload Python Package to PyPI
162

173
on:
18-
release:
19-
types:
20-
- published
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- main
219

2210
jobs:
2311
deploy:
2412
runs-on: ubuntu-latest
2513

2614
steps:
27-
- uses: actions/checkout@v3
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
2818
- name: Set up Python
2919
uses: actions/setup-python@v4
3020
with:
31-
python-version: '3.x'
21+
python-version: '3.13'
22+
23+
- name: Install UV
24+
uses: astral-sh/setup-uv@v7
25+
3226
- name: Install dependencies
3327
run: |
34-
python -m pip install --upgrade pip
35-
python -m pip install build
28+
make install
29+
3630
- name: Build package
37-
run: python -m build
31+
run: |
32+
make build
33+
3834
- name: Publish package
3935
uses: pypa/gh-action-pypi-publish@release/v1
4036
with:

.github/workflows/test-package.yml

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
# Copyright 2022 J.P. Morgan Chase & Co.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4-
# the License. You may obtain a copy of the License at
5-
#
6-
# http://www.apache.org/licenses/LICENSE-2.0
7-
#
8-
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
9-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10-
# specific language governing permissions and limitations under the License.
11-
12-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
13-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
14-
15-
name: Test Python package with Tox
1+
name: LocalStack py-avro-schema / Run Tests
162

173
on:
184
push:
@@ -23,23 +9,25 @@ on:
239
jobs:
2410
build:
2511
runs-on: ubuntu-latest
26-
strategy:
27-
fail-fast: false
28-
matrix:
29-
python-version:
30-
- '3.11'
31-
- '3.12'
32-
- '3.13'
3312

3413
steps:
3514
- uses: actions/checkout@v4
36-
- name: Set up Python ${{ matrix.python-version }}
15+
- name: Set up Python
3716
uses: actions/setup-python@v5
3817
with:
39-
python-version: ${{ matrix.python-version }}
18+
python-version: "3.13"
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v7
22+
4023
- name: Install dependencies
4124
run: |
42-
python -m pip install --upgrade pip
43-
python -m pip install tox tox-gh-actions
44-
- name: Run Tox commands
45-
run: python -m tox
25+
make install-dev
26+
27+
- name: Linting
28+
run: |
29+
make lint
30+
31+
- name: Execute tests
32+
run: |
33+
make test

.pre-commit-config.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
VENV_DIR ?= .venv
2+
VENV_RUN = . $(VENV_DIR)/bin/activate
3+
VENV_ACTIVATE = $(VENV_DIR)/bin/activate
4+
TEST_PATH ?= .
5+
TEST_EXEC ?= python -m
6+
PYTEST_LOGLEVEL ?= warning
7+
8+
install:
9+
uv venv --clear
10+
uv sync --no-dev
11+
12+
install-dev:
13+
uv venv --clear
14+
uv sync --group testing --group linting
15+
16+
clean:
17+
rm -rf $(VENV_DIR)
18+
19+
clean-dist:
20+
rm -rf dist/
21+
22+
build:
23+
uv build
24+
25+
format:
26+
($(VENV_RUN); python -m ruff format; python -m ruff check --output-format=full --fix .)
27+
28+
lint:
29+
($(VENV_RUN); python -m ruff check --output-format=full . && python -m ruff format --check .)
30+
31+
test:
32+
($(VENV_RUN); $(TEST_EXEC) pytest --durations=10 --log-cli-level=$(PYTEST_LOGLEVEL) $(PYTEST_ARGS) $(TEST_PATH))
33+
34+
.PHONY: clean install install-dev clean clean-dist build publish format lint test

README.md

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,23 @@
1-
# py-avro-schema
1+
# LocalStack py-avro-schema
22

3-
Generate [Apache Avro][] schemas for Python types including standard library [data-classes][] and [Pydantic data models][].
4-
5-
:blue_book: Documentation: https://py-avro-schema.readthedocs.io
3+
This project is built on [py-avro-schema](https://github.com/jpmorganchase/py-avro-schema).
64

5+
## Developing
76

8-
## Installing
7+
To setup a virtual environment under `.venv/`, first install `uv`, then run:
98

109
```shell
11-
python -m pip install py-avro-schema
10+
make install-dev
1211
```
1312

14-
## Developing
13+
## Release a new version
1514

16-
To setup a scratch/development virtual environment (under `.venv/`), first install [Tox][].
17-
Then run:
15+
To release a new version you can create a tag with the following commands:
1816

1917
```shell
20-
tox -e dev
18+
git tag v4.0.0
19+
git push origin v4.0.0
2120
```
2221

23-
The `py-avro-schema` package is installed in [editable mode][] inside the `.venv/` environment.
24-
25-
Run tests by simply calling `tox`.
26-
27-
Install code quality Git hooks using `pre-commit install --install-hooks`.
28-
29-
30-
## Terms & Conditions
31-
32-
Copyright 2022 J.P. Morgan Chase & Co.
33-
34-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
35-
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
36-
37-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
38-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
39-
specific language governing permissions and limitations under the License.
40-
41-
42-
## Contributing
43-
44-
See [CONTRIBUTING.md][]
45-
46-
47-
[Apache Avro]: https://avro.apache.org
48-
[data-classes]: https://docs.python.org/3/library/dataclasses.html
49-
[Pydantic data models]: https://docs.pydantic.dev/usage/models
50-
[Tox]: https://tox.wiki
51-
[editable mode]: https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-e
52-
[CONTRIBUTING.md]: https://github.com/jpmorganchase/.github/blob/main/CONTRIBUTING.md
22+
This will create a git tag and push it to the remote repository.
23+
This will trigger the build workflow and publish the package to PyPI.

docs/conf.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)