Skip to content

Commit c863685

Browse files
committed
Switching to uv and ruff, date update
1 parent ec7a054 commit c863685

30 files changed

+1160
-170
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [ created ]
9+
10+
jobs:
11+
deploy-generic:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.13'
22+
23+
24+
- name: Install the latest version of uv and activate the environment
25+
uses: astral-sh/setup-uv@v6
26+
with:
27+
activate-environment: true
28+
29+
- name: Install Dependencies
30+
run: uv sync --frozen
31+
32+
- name: Build and Publish
33+
env:
34+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
35+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
36+
run: |
37+
uv build
38+
twine upload dist/*

.github/workflows/tests.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,26 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
python-version: [ 3.6, 3.7, 3.8 ]
16+
python-version: [ 3.9, 3.10, 3.11, 3.12, 3.12]
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
20+
2021
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v5
2223
with:
2324
python-version: ${{ matrix.python-version }}
2425

26+
- name: Install the latest version of uv and activate the environment
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
activate-environment: true
30+
2531
- name: Install dependencies
26-
run: |
27-
sudo apt install unrar
28-
python -m pip install --upgrade pip
29-
pip install black==20.8b1
30-
pip install -r requirements-test.txt
31-
- name: Lint with black
32-
run: python -m black --check . --config=.black.toml
32+
run: uv sync --frozen
33+
34+
- name: Lint with ruff
35+
run: ruff check
36+
3337
- name: Test with pytest
34-
run: pytest --cov=reusables
38+
run: pytest

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
Version 1.0.0
55
-------------
66

7+
- Fixing warning about escape sequences
78
- Fixing default of defaultlist
89
- Changing testing from Travis CI to github actions
910
- Removing Python 2.x support

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2020 Chris Griffith
3+
Copyright (c) 2014-2025 Chris Griffith
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ License
387387

388388
The MIT License (MIT)
389389

390-
Copyright (c) 2014-2020 Chris Griffith
390+
Copyright (c) 2014-2025 Chris Griffith
391391

392392
Permission is hereby granted, free of charge, to any person obtaining a copy of
393393
this software and associated documentation files (the "Software"), to deal in

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
# General information about the project.
6565
project = "Reusables"
66-
copyright = "2014-2020, Chris Griffith"
66+
copyright = "2014-2025, Chris Griffith"
6767

6868
# The version info for the project you're documenting, acts as replacement for
6969
# |version| and |release|, also used in various other places throughout the

pyproject.toml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
[project]
2+
name = "reusables"
3+
dynamic = ["version"]
4+
description = "Commonly Consumed Code Commodities"
5+
readme = "README.rst"
6+
license = "MIT"
7+
requires-python = ">3.8"
8+
authors = [
9+
{ name = "Chris Griffith", email = "[email protected]" },
10+
]
11+
classifiers = [
12+
"Development Status :: 4 - Beta",
13+
"Environment :: Web Environment",
14+
"Intended Audience :: Developers",
15+
"Intended Audience :: System Administrators",
16+
"Natural Language :: English",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Programming Language :: Python :: Implementation :: CPython",
26+
"Programming Language :: Python :: Implementation :: PyPy",
27+
"Topic :: Documentation :: Sphinx",
28+
"Topic :: Software Development",
29+
"Topic :: Software Development :: Libraries :: Python Modules",
30+
"Topic :: System :: Archiving",
31+
"Topic :: System :: Archiving :: Compression",
32+
"Topic :: System :: Filesystems",
33+
"Topic :: System :: Logging",
34+
"Topic :: Utilities",
35+
]
36+
dependencies = []
37+
38+
[project.urls]
39+
Homepage = "https://github.com/cdgriffith/Reusables"
40+
41+
[dependency-groups]
42+
dev = [
43+
"pytest>=8.3.5",
44+
"rarfile>=4.2",
45+
"ruff>=0.12.1",
46+
"twine>=6.1.0",
47+
"wheel>=0.45.1",
48+
]
49+
50+
[build-system]
51+
requires = ["setuptools", "wheel"]
52+
build-backend = "setuptools.build_meta"
53+
54+
[tool.setuptools.dynamic]
55+
version = { attr = "reusables.__version__" }
56+
57+
[tool.ruff]
58+
# Exclude a variety of commonly ignored directories.
59+
exclude = [
60+
".direnv",
61+
".eggs",
62+
".git",
63+
".git-rewrite",
64+
".ipynb_checkpoints",
65+
".mypy_cache",
66+
".pytest_cache",
67+
".pytype",
68+
".ruff_cache",
69+
".venv",
70+
".vscode",
71+
"__pypackages__",
72+
"_build",
73+
"buck-out",
74+
"build",
75+
"dist",
76+
"venv",
77+
]
78+
79+
line-length = 120
80+
indent-width = 4
81+
82+
target-version = "py313"
83+
84+
[tool.ruff.lint]
85+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
86+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
87+
# McCabe complexity (`C901`) by default.
88+
#select = ["E4", "E7", "E9", "F"]
89+
#ignore = []
90+
91+
# Allow fix for all enabled rules (when `--fix`) is provided.
92+
#fixable = ["F401", "F541", "F405"]
93+
#unfixable = []
94+
95+
[tool.ruff.format]
96+
# Like Black, use double quotes for strings.
97+
quote-style = "double"
98+
99+
# Like Black, indent with spaces, rather than tabs.
100+
indent-style = "space"
101+
102+
# Like Black, respect magic trailing commas.
103+
skip-magic-trailing-comma = false
104+
105+
line-ending = "lf"
106+
107+
# Enable auto-formatting of code examples in docstrings. Markdown,
108+
# reStructuredText code/literal blocks and doctests are all supported.
109+
#
110+
# This is currently disabled by default, but it is planned for this
111+
# to be opt-out in the future.
112+
docstring-code-format = true
113+
114+
# Set the line length limit used when formatting code snippets in
115+
# docstrings.
116+
#
117+
# This only has an effect when the `docstring-code-format` setting is
118+
# enabled.
119+
docstring-code-line-length = "dynamic"

requirements-test.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

reusables/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Part of the Reusables package.
55
#
6-
# Copyright (c) 2014-2020 - Chris Griffith - MIT License
6+
# Copyright (c) 2014-2025 - Chris Griffith - MIT License
77
from __future__ import absolute_import
88

99
from reusables.string_manipulation import *
@@ -23,4 +23,4 @@
2323
from reusables.default_list import *
2424

2525
__author__ = "Chris Griffith"
26-
__version__ = "1.0.0a0"
26+
__version__ = "1.0.0"

0 commit comments

Comments
 (0)