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

Version bump 2.0.0 #45

Merged
merged 3 commits into from
Sep 16, 2024
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
on:
release:
types: [published]
jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Build package distributions
run: |
pip install build
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -45,3 +45,8 @@ repos:
args:
- --fix
- --exit-non-zero-on-fix
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.0.0 (2024-09-13)

### Feat

- make `client.request` return response object rather than content

## 1.0.0 (2023-12-13)

### Feat
107 changes: 107 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
Contributing to Simple Github
=============================

Thanks for your interest in simple-github! To participate in this community, please
review our [code of conduct][0].

[0]: https://github.com/mozilla-releng/simple-github/blob/main/CODE_OF_CONDUCT.md

Clone the Repo
--------------

To contribute to simple-github, you'll need to clone the repository:

```
# first fork simple-github
git clone https://github.com/<user>/simple-github
cd simple-github
git remote add upstream https://github.com/mozilla-releng/simple-github
```

Setting Up the Environment
--------------------------

We use a tool called [uv][1] to manage simple-github and its dependencies. First,
follow the [installation instructions][2].

Then run:

```
uv sync
```

This does several things:

1. Creates a virtualenv for the project in a ``.venv`` directory (if necessary).
2. Syncs the project's dependencies as pinned in ``uv.lock`` (if necessary).
3. Installs ``simple-github`` as an editable package (if necessary).

Now you can prefix commands with `uv run` and they'll have access to this
environment.

[1]: https://docs.astral.sh/uv/
[2]: https://docs.astral.sh/uv/getting-started/installation/

Running Tests
-------------

Tests are run with the [pytest][3] framework:

```
uv run pytest
```

[3]: https://docs.pytest.org

Running Checks
--------------

Linters and formatters are run via [pre-commit][4]. To install the hooks, run:

```
pre-commit install -t pre-commit -t commit-msg
```

Now checks will automatically run on every commit. If you prefer to run checks
manually, you can use:

```
pre-commit run
```

Most of the checks we enforce are done with [ruff][5]. See
[pre-commit-config.yaml][6] for a full list of linters and formatters.

[4]: https://pre-commit.com/
[5]: https://docs.astral.sh/ruff/
[6]: https://github.com/mozilla-releng/simple-github/blob/main/.pre-commit-config.yaml

Releasing
---------

A tool called [commitizen][7] can optionally be used to assist with releasing
the package. First install it with:

```
uv tool install commitizen
```

Then create the version bump commit:

```
cz changelog
cz bump
git show
```

Create a pull request and get the commit merged into `main`. Once merged, make sure
your tag is pushed upstream:

```
git push upstream --tags
```

Finally, create a release in Github, choosing the tag that you just pushed.
This will trigger the `pypi-publish` workflow and upload the package to pypi.

[7]: https://commitizen-tools.github.io/commitizen/
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "simple-github"
description = "A simple Github client that only provides auth and access to the REST and GraphQL APIs."
version = "1.0.0"
version = "2.0.0"
authors = [
{ name = "Mozilla Release Engineering", email = "[email protected]"}
]
@@ -42,6 +42,11 @@ dev-dependencies = [
"tox~=4.11",
]

[tool.commitizen]
bump_message = "chore: version bump $new_version"
changelog_incremental = true
version_provider = "pep621"

[tool.black]
line-length = 88