Skip to content

Commit

Permalink
First version
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Feb 16, 2024
0 parents commit 7896534
Show file tree
Hide file tree
Showing 29 changed files with 1,040 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @gaborbernat
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tidelift: pypi/tox-uv
13 changes: 13 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

| Version | Supported |
|---------| ------------------ |
| 1.0.0 + | :white_check_mark: |
| < 1.0.0 | :x: |

## Reporting a Vulnerability

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift
will coordinate the fix and disclosure.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
72 changes: 72 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: check
on:
workflow_dispatch:
push:
branches: ["main"]
tags-ignore: ["**"]
pull_request:
schedule:
- cron: "0 8 * * *"

concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: test ${{ matrix.py }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- name: setup python for tox
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install self
run: python -m pip install .
- uses: actions/checkout@v4
- name: setup python for test ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Pick environment to run
run: |
import codecs; import os; import sys
env = "TOXENV=py{}{}\n".format(*sys.version_info[0:2])
print("Picked:\n{}for{}".format(env, sys.version))
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
file_handler.write(env)
shell: python
- name: setup test suite
run: tox -vv --notest
- name: run test suite
run: tox --skip-pkg-install

check:
name: tox env ${{ matrix.tox_env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tox_env:
- type
- dev
- readme
steps:
- uses: actions/checkout@v4
- name: setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install self
run: python -m pip install .
- name: run check for ${{ matrix.tox_env }}
run: python -m tox -e ${{ matrix.tox_env }}
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release to PyPI
on:
push:
tags: ["*"]

jobs:
release:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/tox-uv
permissions:
id-token: write
steps:
- name: Setup python to build package
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build
run: python -m pip install build
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build package
run: pyproject-build -s -w . -o dist
- name: Publish to PyPI
uses: pypa/[email protected]
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/magic
.idea
*.egg-info
.tox/
.coverage*
coverage.xml
.*_cache
__pycache__
**.pyc
/build
dist
src/tox_uv/version.py
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies: ["tomli>=2.0.1"]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.7.0"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.2.1"
hooks:
- id: ruff-format
- id: ruff
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# tox-uv

[![PyPI version](https://badge.fury.io/py/tox-uv.svg)](https://badge.fury.io/py/tox-uv)
[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/tox-uv.svg)](https://pypi.python.org/pypi/tox-uv/)
[![check](https://github.com/tox-dev/tox-uv/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/tox-uv/actions/workflows/check.yml)
[![Downloads](https://static.pepy.tech/badge/tox-uv/month)](https://pepy.tech/project/tox-uv)

**tox-uv** is a tox plugin which replaces pip with uv in tox.
115 changes: 115 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.21.1",
]

[project]
name = "tox-uv"
description = "Integration of uv into GitHub Actions."
readme = "README.md"
keywords = [
"environments",
"isolated",
"testing",
"virtual",
]
license = "MIT"
maintainers = [{ name = "Bernát Gábor", email = "[email protected]" }]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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 :: Internet",
"Topic :: Software Development :: Libraries",
"Topic :: System",
]
dynamic = [
"version",
]
dependencies = [
"tox<5,>=4.12.1",
"uv<1,>=0.1.1",
]
optional-dependencies.test = [
"covdefaults>=2.3",
"devpi-process>=1",
"pytest>=8",
"pytest-cov>=4.1",
"pytest-mock>=3.12",
]
urls.Documentation = "https://github.com/tox-dev/tox-uv#tox-uv"
urls.Homepage = "https://github.com/tox-dev/tox-uv"
urls.Source = "https://github.com/tox-dev/tox-uv"
urls.Tracker = "https://github.com/tox-dev/tox-uv/issues"
entry-points.tox = {"tox-uv" = "tox_uv.plugin"}

[tool.hatch]
build.hooks.vcs.version-file = "src/tox_uv/version.py"
build.targets.sdist.include = ["/src", "/tests"]
version.source = "vcs"

[tool.black]
line-length = 120

[tool.ruff]
line-length = 120
target-version = "py38"
lint.isort = { known-first-party = ["tox_uv", "tests"], required-imports = ["from __future__ import annotations"] }
lint.select = ["ALL"]
lint.ignore = [
"ANN101", # Missing type annotation for `self` in method
"D301", # Use `r"""` if any backslashes in a docstring
"D205", # 1 blank line required between summary line and description
"D401", # First line of docstring should be in imperative mood
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"S104", # Possible binding to all interface
"COM812", # Conflict with formatter
"ISC001", # Conflict with formatter
"CPY", # No copyriuvt statements
"D", # no documentation for now
]
lint.preview = true
format.preview = true
format.docstring-code-format = true
format.docstring-code-line-length = 100
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # asserts allowed in tests...
"FBT", # don"t care about booleans as positional arguments in tests
"INP001", # no implicit namespace
"D", # don"t care about documentation in tests
"S603", # `subprocess` call: check for execution of untrusted input
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
]

[tool.codespell]
builtin = "clear,usage,en-GB_to_en-US"
write-changes = true
count = true

[tool.coverage]
html.show_contexts = true
html.skip_covered = false
paths.source = ["src", ".tox/*/.venv/lib/*/site-packages", ".tox\\*\\.venv\\Lib\\site-packages", "**/src", "**\\src"]
paths.other = [".", "*/tox_uv", "*\\tox_uv"]
report.fail_under = 96
run.parallel = true
run.plugins = ["covdefaults"]

[tool.mypy]
python_version = "3.11"
show_error_codes = true
strict = true
overrides = [{ module = ["virtualenv.*"], ignore_missing_imports = true }]
9 changes: 9 additions & 0 deletions src/tox_uv/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""GitHub Actions integration."""

from __future__ import annotations

from .version import version as __version__

__all__ = [
"__version__",
]
Loading

0 comments on commit 7896534

Please sign in to comment.