Skip to content

Commit 7ff2bbd

Browse files
committed
Create first version (#1)
Signed-off-by: Bernát Gábor <[email protected]>
1 parent a7a8a88 commit 7ff2bbd

17 files changed

+572
-1
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tidelift: "pypi/pre-commit-uv"

.github/SECURITY.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
|---------| ------------------ |
7+
| 0.1 + | :white_check_mark: |
8+
| < 0.1 | :x: |
9+
10+
## Reporting a Vulnerability
11+
12+
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift
13+
will coordinate the fix and disclosure.

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/release.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- dependabot
5+
- pre-commit-ci

.github/workflows/check.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: check
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: ["main"]
6+
tags-ignore: ["**"]
7+
pull_request:
8+
schedule:
9+
- cron: "0 8 * * *"
10+
11+
concurrency:
12+
group: check-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test:
17+
name: test ${{ matrix.py }}
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
py:
23+
- "3.12"
24+
- "3.11"
25+
- "3.10"
26+
- "3.9"
27+
steps:
28+
- name: setup uv for tox
29+
uses: yezz123/setup-uv@v4
30+
- name: setup python for tox
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.12"
34+
- name: install tox
35+
run: uv pip install tox tox-uv --system
36+
- uses: actions/checkout@v4
37+
- name: setup python for test ${{ matrix.py }}
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.py }}
41+
- name: Pick environment to run
42+
run: |
43+
import codecs; import os; import sys
44+
env = "TOXENV=py{}{}\n".format(*sys.version_info[0:2])
45+
print("Picked:\n{}for{}".format(env, sys.version))
46+
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
47+
file_handler.write(env)
48+
shell: python
49+
- name: setup test suite
50+
run: tox -vv --notest
51+
- name: run test suite
52+
run: tox --skip-pkg-install
53+
54+
check:
55+
name: tox env ${{ matrix.tox_env }}
56+
runs-on: ubuntu-latest
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
tox_env:
61+
- type
62+
- dev
63+
- readme
64+
steps:
65+
- name: setup uv for tox
66+
uses: yezz123/setup-uv@v4
67+
- uses: actions/checkout@v4
68+
- name: setup Python 3.12
69+
uses: actions/setup-python@v5
70+
with:
71+
python-version: "3.12"
72+
- name: install tox
73+
run: uv pip install tox tox-uv --system
74+
- name: run check for ${{ matrix.tox_env }}
75+
run: python -m tox -e ${{ matrix.tox_env }}
76+
env:
77+
UPGRADE_ADVISORY: "yes"

.github/workflows/release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release to PyPI
2+
on:
3+
push:
4+
tags: ["*"]
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
environment:
10+
name: release
11+
url: https://pypi.org/p/pre-commit-uv
12+
permissions:
13+
id-token: write
14+
steps:
15+
- name: Setup python to build package
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
- name: Install build
20+
run: python -m pip install build
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: Build package
25+
run: pyproject-build -s -w . -o dist
26+
- name: Publish to PyPI
27+
uses: pypa/[email protected]

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.egg-info/
2+
.tox/
3+
.*_cache
4+
__pycache__
5+
**.pyc
6+
dist

.pre-commit-config.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- repo: https://github.com/python-jsonschema/check-jsonschema
8+
rev: 0.29.1
9+
hooks:
10+
- id: check-github-workflows
11+
args: [ "--verbose" ]
12+
- repo: https://github.com/codespell-project/codespell
13+
rev: v2.3.0
14+
hooks:
15+
- id: codespell
16+
args: ["--write-changes"]
17+
- repo: https://github.com/tox-dev/tox-ini-fmt
18+
rev: "1.3.1"
19+
hooks:
20+
- id: tox-ini-fmt
21+
args: ["-p", "fix"]
22+
- repo: https://github.com/tox-dev/pyproject-fmt
23+
rev: "2.2.0"
24+
hooks:
25+
- id: pyproject-fmt
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: "v0.5.6"
28+
hooks:
29+
- id: ruff-format
30+
- id: ruff
31+
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
32+
- repo: meta
33+
hooks:
34+
- id: check-hooks-apply
35+
- id: check-useless-excludes

CODE_OF_CONDUCT.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
6+
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
7+
disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race,
8+
religion, or sexual identity and orientation.
9+
10+
## Our Standards
11+
12+
Examples of behavior that contributes to creating a positive environment include:
13+
14+
- Using welcoming and inclusive language
15+
- Being respectful of differing viewpoints and experiences
16+
- Gracefully accepting constructive criticism
17+
- Focusing on what is best for the community
18+
- Showing empathy towards other community members
19+
20+
Examples of unacceptable behavior by participants include:
21+
22+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
23+
- Trolling, insulting/derogatory comments, and personal or political attacks
24+
- Public or private harassment
25+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
26+
- Other conduct which could reasonably be considered inappropriate in a professional setting
27+
28+
## Our Responsibilities
29+
30+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
31+
appropriate and fair corrective action in response to any instances of unacceptable behavior.
32+
33+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
34+
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
35+
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
36+
37+
## Scope
38+
39+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
40+
project or its community. Examples of representing a project or community include using an official project e-mail
41+
address, posting via an official social media account, or acting as an appointed representative at an online or offline
42+
event. Representation of a project may be further defined and clarified by project maintainers.
43+
44+
## Enforcement
45+
46+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
47+
[email protected]. The project team will review and investigate all complaints, and will respond in a way that it
48+
deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the
49+
reporter of an incident. Further details of specific enforcement policies may be posted separately.
50+
51+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
52+
repercussions as determined by other members of the project's leadership.
53+
54+
## Attribution
55+
56+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
57+
[https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][version]
58+
59+
[homepage]: https://www.contributor-covenant.org/
60+
[version]: https://www.contributor-covenant.org/version/1/4/

LICENSE.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a
2+
copy of this software and associated documentation files (the
3+
"Software"), to deal in the Software without restriction, including
4+
without limitation the rights to use, copy, modify, merge, publish,
5+
distribute, sublicense, and/or sell copies of the Software, and to
6+
permit persons to whom the Software is furnished to do so, subject to
7+
the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included
10+
in all copies or substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
16+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
# pre-commit-uv
1+
# pre-commit-uv
2+
3+
[![PyPI](https://img.shields.io/pypi/v/pre-commit-uv?style=flat-square)](https://pypi.org/project/pre-commit-uv)
4+
[![PyPI - Implementation](https://img.shields.io/pypi/implementation/pre-commit-uv?style=flat-square)](https://pypi.org/project/pre-commit-uv)
5+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pre-commit-uv?style=flat-square)](https://pypi.org/project/pre-commit-uv)
6+
[![Downloads](https://static.pepy.tech/badge/pre-commit-uv/month)](https://pepy.tech/project/pre-commit-uv)
7+
[![PyPI - License](https://img.shields.io/pypi/l/pre-commit-uv?style=flat-square)](https://opensource.org/licenses/MIT)
8+
[![check](https://github.com/tox-dev/pre-commit-uv/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/pre-commit-uv/actions/workflows/check.yml)
9+
10+
Use `uv` to create virtual environments and install packages for `pre-commit`.
11+
12+
## Configuration
13+
14+
Once installed will use `uv` out of box, however the `DISABLE_PRE_COMMIT_UV_PATCH` environment variable if set will work as an escape hatch.

0 commit comments

Comments
 (0)