Skip to content

Commit 7648acf

Browse files
drozdowskyKarolJagodzinski
authored andcommitted
Workflows, contrib, typos changes
1 parent dc3f015 commit 7648acf

File tree

7 files changed

+172
-40
lines changed

7 files changed

+172
-40
lines changed

.github/workflows/build.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
env:
8+
PYTHONUNBUFFERED: "1"
9+
FORCE_COLOR: "1"
10+
11+
jobs:
12+
test:
13+
uses: ./.github/workflows/test.yml
14+
permissions:
15+
contents: read
16+
build:
17+
name: Build distribution 📦
18+
runs-on: ubuntu-latest
19+
needs:
20+
- test
21+
steps:
22+
- name: Checkout source code
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python 3.12
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version-file: pyproject.toml
29+
30+
- name: Install Hatch
31+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
32+
33+
- name: Set package version from tag
34+
run: hatch version $(git describe --tags --always)
35+
36+
- name: Build package
37+
run: hatch build
38+
39+
- name: Store the distribution packages
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: python-package-distributions
43+
path: dist/
44+
45+
sign-release:
46+
name: >-
47+
Sign the Python 🐍 distribution 📦 with Sigstore
48+
needs:
49+
- build
50+
runs-on: ubuntu-latest
51+
permissions:
52+
id-token: write # IMPORTANT: mandatory for sigstore
53+
steps:
54+
- name: Download all the dists
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: python-package-distributions
58+
path: dist/
59+
- name: Sign the dists with Sigstore
60+
uses: sigstore/[email protected]
61+
with:
62+
inputs: >-
63+
./dist/*.tar.gz
64+
./dist/*.whl
65+
- name: Store the signature files
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: python-package-distributions
69+
path: dist/
70+
overwrite: true

.github/workflows/prepare_release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Prepare release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_call:
8+
workflow_dispatch:
9+
10+
env:
11+
PYTHONUNBUFFERED: "1"
12+
FORCE_COLOR: "1"
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build.yml
17+
permissions:
18+
contents: read
19+
id-token: write # IMPORTANT: mandatory for sigstore in build.yml
20+
21+
create-release:
22+
needs:
23+
- build
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Download all the dists
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
- name: Release
32+
id: create-draft-release
33+
uses: softprops/action-gh-release@v2
34+
with:
35+
files: |
36+
./dist/*
37+
draft: true
38+
- name: Summary
39+
run: |
40+
echo "# Release summary" >> $GITHUB_STEP_SUMMARY
41+
echo "Url: ${{ steps.create-draft-release.outputs.url }}" >> $GITHUB_STEP_SUMMARY
42+
echo "You can now publish the release on GitHub" >> $GITHUB_STEP_SUMMARY

.github/workflows/publish.yml

+33-26
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
1-
name: Publish on PyPI
1+
name: Publish
22

33
on:
44
release:
55
types:
66
- published
7+
workflow_call:
8+
workflow_dispatch:
9+
10+
env:
11+
PYTHONUNBUFFERED: "1"
12+
FORCE_COLOR: "1"
713

814
jobs:
9-
build-n-publish:
10-
name: Build and publish to PyPI
15+
publish-to-pypi:
16+
name: >-
17+
Publish Python 🐍 distribution 📦 to PyPI
18+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
1119
runs-on: ubuntu-latest
20+
environment:
21+
name: pypi
22+
url: https://pypi.org/p/ariadne-codegen
23+
permissions:
24+
# IMPORTANT: this permission is mandatory for trusted publishing
25+
id-token: write
26+
contents: read
27+
1228
steps:
13-
- uses: actions/checkout@master
14-
- name: Set up Python 3.10
15-
uses: actions/setup-python@v4
16-
with:
17-
python-version: "3.10"
18-
- name: Install pypa/build
19-
run: >-
20-
python -m
21-
pip install
22-
build
23-
--user
24-
- name: Build a binary wheel and a source tarball
25-
run: >-
26-
python -m build
27-
--sdist
28-
--wheel
29-
--outdir dist/
30-
.
31-
- name: Publish distribution to PyPI
32-
if: startsWith(github.ref, 'refs/tags')
33-
uses: pypa/gh-action-pypi-publish@release/v1
34-
with:
35-
password: ${{ secrets.PYPI_API_TOKEN }}
29+
- name: Download all the dists from the release
30+
env:
31+
GITHUB_TOKEN: ${{ github.token }}
32+
run: >-
33+
gh release download
34+
'${{ github.ref_name }}'
35+
-p '*.whl'
36+
-p '*.tar.gz'
37+
--dir dist/
38+
--repo '${{ github.repository }}'
39+
- name: Publish package distributions to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
skip-existing: true
File renamed without changes.

CONTRIBUTING.md

+25-12
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,41 @@ You can use [GitHub issues](https://github.com/mirumee/ariadne-codegen/issues) t
1414

1515
## Development setup
1616

17-
Ariadne Code Generator is written to support Python 3.9, 3.10 and 3.11.
17+
Ariadne Code Generator is written to support Python 3.9, 3.10, 3.11, 3.12 and 3.13.
1818

19-
Codebase is formatted using [black](https://github.com/ambv/black) and [isort](https://github.com/PyCQA/isort), the contents of the `ariadne-codegen` package are annotated with types and validated using [mypy](http://mypy-lang.org/index.html). [Pylint](https://github.com/pylint-dev/pylint) is used to catch errors in code.
19+
We use [Hatch](https://github.com/pypa/hatch) for project management.
2020

21-
Tests are developed using [pytest](https://pytest.org/).
21+
The codebase is formatted using [ruff](https://github.com/astral-sh/ruff).
22+
To format the code, use the following command:
23+
```bash
24+
hatch fmt
25+
```
2226

23-
Dev requirements can be installed using Pip extras. For example, to install all dependencies for doing local development and running the tests, run `pip install -e .[subscriptions,dev]`.
27+
The contents of the `ariadne-codegen` package are annotated with types and validated using [mypy](http://mypy-lang.org/index.html). To run type checking with mypy, use:
28+
```bash
29+
hatch run types:check
30+
```
2431

25-
We require all changes to be done via pull requests, and to be approved by member-ranked users before merging.
2632

27-
All changes should pass these linter checks:
33+
Tests are developed using [pytest](https://pytest.org/) and are managed with Hatch.
34+
2835

36+
To run the tests, use:
2937
```bash
30-
pylint ariadne_codegen tests
31-
mypy ariadne_codegen --ignore-missing-imports
32-
mypy --strict tests/main/clients/*/expected_client
33-
mypy --strict tests/main/graphql_schemas/*/expected_schema.py
34-
black --check .
35-
isort . --check-only
38+
hatch test
3639
```
3740

3841

42+
To run all checks (formatting, type checking, and tests), you can use:
43+
```bash
44+
hatch run check
45+
```
46+
47+
We require all changes to be done via pull requests, and to be approved by member-ranked users before merging.
48+
49+
All changes should pass these linter checks.
50+
51+
3952
## Working on issues
4053

4154
We consider all issues which are not assigned to anybody as being available for contributors. The **[help wanted](https://github.com/mirumee/ariadne-codegen/labels/help%20wanted)** label is used to single out issues that we consider easier or higher priority on the list of things that we would like to see.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2023, Mirumee Labs
3+
Copyright (c) 2025, Mirumee Labs
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "ariadne-codegen"
77
description = "Generate fully typed GraphQL client from schema, queries and mutations!"
88
authors = [{ name = "Mirumee Software", email = "[email protected]" }]
9-
version = "0.14.1"
9+
dynamic = ["version"]
1010
requires-python = ">= 3.9"
1111
readme = "README.md"
1212
license = "BSD-3-Clause"

0 commit comments

Comments
 (0)