Skip to content

Commit dd130a8

Browse files
committed
switch to pyproject
1 parent 1d9dbd0 commit dd130a8

File tree

11 files changed

+456
-82
lines changed

11 files changed

+456
-82
lines changed

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ docker-remove:
3131
.PHONY: branchify
3232
branchify:
3333
ifneq ($(shell git rev-parse --abbrev-ref HEAD),main)
34-
sed -i "s/^version\s*=\s*[0-9]*\.[0-9]*\.[0-9]*/&.dev$(shell date +%s)/g" setup.cfg
34+
# Create a portable sed command that works on both Linux and macOS
35+
if [ "$(shell uname)" = "Darwin" ]; then \
36+
sed -i '' 's/version = "\([0-9]*\.[0-9]*\.[0-9]*\)"/version = "\1.dev$(shell date +%s)"/g' pyproject.toml; \
37+
else \
38+
sed -i 's/version = "\([0-9]*\.[0-9]*\.[0-9]*\)"/version = "\1.dev$(shell date +%s)"/g' pyproject.toml; \
39+
fi
3540
endif
3641

3742
.PHONY: publish
@@ -40,12 +45,12 @@ publish: branchify
4045
rm -rf dist
4146
python -m build
4247
twine upload dist/* --username $(PYPI_USERNAME) --password $(PYPI_PASSWORD)
43-
git checkout -- setup.cfg
48+
git checkout -- pyproject.toml
4449
rm -rf dist
4550

4651
.PHONY: freeze
4752
freeze:
48-
uv pip compile -q -o requirements.txt setup.cfg
53+
uv pip compile -q -o requirements.txt pyproject.toml
4954
echo "-e ." >> requirements.txt
50-
uv pip compile -q --extra dev -o requirements-dev.txt setup.cfg
55+
uv pip compile -q --extra dev -o requirements-dev.txt pyproject.toml
5156
echo "-e ." >> requirements-dev.txt

pyproject.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sparrow-patterns"
7+
version = "0.8.0"
8+
description = "A CLI for updating code patterns in Python projects"
9+
authors = [
10+
{name = "Sparrow Computing", email = "[email protected]"},
11+
]
12+
license = {text = "MIT"}
13+
requires-python = ">=3.6"
14+
dependencies = [
15+
"fire",
16+
"jinja2",
17+
"python-slugify",
18+
]
19+
20+
[project.optional-dependencies]
21+
dev = [
22+
"jupyter",
23+
"pytest",
24+
"pytest-cov",
25+
"types-python-slugify",
26+
]
27+
28+
[project.scripts]
29+
sparrow-patterns = "sparrow_patterns.__main__:main"
30+
31+
[project.entry-points.console_scripts]
32+
sparrow-patterns = "sparrow_patterns.__main__:main"
33+
34+
[tool.setuptools.package-data]
35+
"sparrow_patterns" = ["**/templates/*"]
36+
37+
[tool.pylint.format]
38+
disable = ["all"]
39+
enable = ["unused-import"]

0 commit comments

Comments
 (0)