Skip to content

Commit 9283897

Browse files
authored
Merge pull request #74 from nschloe/flit
Flit
2 parents f6d6855 + 5a7aa61 commit 9283897

File tree

5 files changed

+42
-56
lines changed

5 files changed

+42
-56
lines changed

justfile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
version := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])"`
2-
name := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['name'])"`
3-
1+
version := `python3 -c "from src.pytest_codeblocks.__about__ import __version__; print(__version__)"`
42

53
default:
64
@echo "\"just publish\"?"
75

8-
tag:
9-
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
10-
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "v{{version}}"}' https://api.github.com/repos/nschloe/{{name}}/releases
11-
12-
upload: clean
6+
publish:
137
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
14-
# https://stackoverflow.com/a/58756491/353337
15-
python3 -m build --sdist --wheel .
16-
twine upload dist/*
17-
18-
publish: tag upload
8+
gh release create "v{{version}}"
9+
flit publish
1910

2011
clean:
2112
@find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf

pyproject.toml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
[build-system]
2-
requires = ["setuptools>=42", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["flit_core >=3.2,<4"]
3+
build-backend = "flit_core.buildapi"
44

55
[tool.isort]
66
profile = "black"
7+
8+
[project]
9+
name = "pytest_codeblocks"
10+
authors = [{name = "Nico Schlömer", email = "[email protected]"}]
11+
description = "Test code blocks in your READMEs"
12+
readme = "README.md"
13+
license = {file = "LICENSE.txt"}
14+
classifiers = [
15+
"Development Status :: 4 - Beta",
16+
"Framework :: Pytest",
17+
"Intended Audience :: Developers",
18+
"License :: OSI Approved :: MIT License",
19+
"Operating System :: OS Independent",
20+
"Programming Language :: Python",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3.7",
23+
"Programming Language :: Python :: 3.8",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
]
27+
dynamic = ["version"]
28+
requires-python = ">=3.7"
29+
dependencies = [
30+
"pytest >= 6"
31+
]
32+
33+
[project.urls]
34+
Code = "https://github.com/nschloe/pytest-codeblocks"
35+
Issues = "https://github.com/nschloe/pytest-codeblocks/issues"
36+
Funding = "https://github.com/sponsors/nschloe"
37+
38+
[project.entry-points.pytest11]
39+
codeblocks = "pytest_codeblocks.plugin"

setup.cfg

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

src/pytest_codeblocks/__about__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.13.0"

src/pytest_codeblocks/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from . import plugin
2+
from .__about__ import __version__
23
from .main import CodeBlock, extract_from_buffer, extract_from_file
34

45
__all__ = [
56
"CodeBlock",
67
"extract_from_buffer",
78
"extract_from_file",
89
"plugin",
10+
"__version__",
911
]

0 commit comments

Comments
 (0)