Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 15 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ jobs:
- 3.9
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v2
with:
# Fetch all history instead of the latest commit
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
pip install -r test_requirements.txt
enable-cache: true
- name: Install the project
run: uv sync --locked --all-extras
- name: Run pre-commit checks
run: pre-commit run --all-files
- name: Test with pytest
run: pytest --junitxml=test-reports/test-results.xml
run: uv run pre-commit run --all-files
- name: Run tests
# For example, using `pytest`
run: uv run pytest
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: github.event_name == 'push' && always()
Expand All @@ -47,17 +47,14 @@ jobs:
with:
# Fetch all history instead of the latest commit
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: 3.8
- name: Remove version file
# This is just in case something else created it, destroy it to get a fresh version
run: rm -f vcsinfo/version.py
- name: Install wheel
run: pip install wheel
- name: Set version
run: uv version --no-sync "$(uv version --short).$(git rev-list --count HEAD)"
- name: Build
run: python setup.py sdist bdist_wheel
run: uv build
- name: Check upload
run: pip install twine && twine check dist/*
- name: Publish to PyPi
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ buildrunner.results
venv
.tox
.env
.venv
.idea

vcsinfo/version.py
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
rev: v0.12.7
hooks:
# Run the linter.
- id: ruff
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.2
3.12
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ Installation

pip install vcsinfo

Development
###########

For development, use uv to install dependencies:

.. code-block::

uv sync

Usage
#####

Expand Down
73 changes: 73 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[build-system]
requires = ["uv_build"]
build-backend = "uv_build"

[project]
name = "vcsinfo"
# This is the base version, the actual version will be set during the build
version = "2.2"
description = "Utilities to normalize working with different Version Control Systems"
readme = "README.rst"
license = {text = "MIT"}
authors = [
{name = "Adobe", email = "noreply@adobe.com"}
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"GitPython>=3.1",
"gitdb>=4",
]

[dependency-groups]
dev = [
"pytest>=6.2.4",
"pytest-randomly>=3.10.1",
"pytest-cov>=2.12.1",
"ruff>=0.12.7",
"pre-commit<3.6",
]

[project.optional-dependencies]
# Make everything except git an optional dependency
hg = ["mercurial"]
p4 = ["p4python"]

[project.scripts]
vcsinfo = "vcsinfo.__main__:main"

[project.urls]
Homepage = "https://github.com/adobe/vcsinfo"

[tool.uv.build-backend]
module-name = "vcsinfo"
module-root = ""
source-exclude = ["vcsinfo/tests"]
wheel-exclude = ["vcsinfo/tests"]

[tool.ruff]
preview = true

[tool.ruff.lint]
# Enable the copyright rule
extend-select = ["CPY"]

[tool.ruff.lint.flake8-copyright]
min-file-size = 200
notice-rgx = '''"""
Copyright 2\d{3} Adobe
All Rights Reserved.

NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
with the terms of the Adobe license agreement accompanying it.
"""'''
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

19 changes: 0 additions & 19 deletions ruff.toml

This file was deleted.

98 changes: 0 additions & 98 deletions setup.py

This file was deleted.

7 changes: 0 additions & 7 deletions test_requirements.in

This file was deleted.

66 changes: 0 additions & 66 deletions test_requirements.txt

This file was deleted.

Loading