Skip to content

Commit 1b6a873

Browse files
authored
add pyproject.toml (#132)
1 parent 8dda657 commit 1b6a873

File tree

3 files changed

+84
-50
lines changed

3 files changed

+84
-50
lines changed

MANIFEST.in

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

pyproject.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[build-system]
2+
requires = ["setuptools>=77", "setuptools-scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "github_activity"
7+
description = "Grab recent issue/PR activity from a GitHub repository and render it as markdown."
8+
# update verison with `tbump NEW_VERSION`
9+
version = "1.0.3"
10+
dynamic = ["readme", "dependencies"]
11+
requires-python = ">=3.9"
12+
keywords = ["Development", "Changelog"]
13+
authors = [
14+
{ name = "Executable Books Project", email = "[email protected]" },
15+
]
16+
license = "BSD-3-Clause"
17+
license-files = []
18+
19+
[project.urls]
20+
Homepage = "https://executablebooks.org"
21+
Source = "https://github.com/executablebooks/github-activity"
22+
23+
[project.optional-dependencies]
24+
testing = [
25+
"pytest",
26+
"pytest-regressions",
27+
]
28+
sphinx = [
29+
"sphinx",
30+
"myst_parser",
31+
"sphinx_book_theme",
32+
]
33+
34+
[project.scripts]
35+
github-activity = "github_activity.cli:main"
36+
37+
[tool.setuptools]
38+
zip-safe = false
39+
include-package-data = true
40+
41+
[tool.setuptools.packages.find]
42+
where = [""]
43+
include = ["github_activity"]
44+
45+
[tool.setuptools.dynamic]
46+
readme = { file = "README.md", content-type = "text/markdown" }
47+
dependencies = { file = "requirements.txt" }
48+
49+
# setuptools_scm needs a section to be present
50+
[tool.setuptools_scm]
51+
# we don't actually use setuptools_scm for versions,
52+
# only the file-finder
53+
fallback_version = "0.0.0"
54+
55+
[tool.tbump]
56+
# Uncomment this if your project is hosted on GitHub:
57+
github_url = "https://github.com/executablebooks/github-activity"
58+
59+
[tool.tbump.version]
60+
current = "1.0.3"
61+
62+
regex = '''
63+
(?P<major>\d+)
64+
\.
65+
(?P<minor>\d+)
66+
\.
67+
(?P<patch>\d+)
68+
(?P<pre>((a|b|rc)\d+)|)
69+
\.?
70+
(?P<dev>(?<=\.)dev\d*|)
71+
'''
72+
73+
[tool.tbump.git]
74+
message_template = "Bump to {new_version}"
75+
tag_template = "v{new_version}"
76+
77+
[[tool.tbump.file]]
78+
src = "pyproject.toml"
79+
search = 'version = "{current_version}"'
80+
81+
[[tool.tbump.file]]
82+
src = "github_activity/__init__.py"
83+
search = '__version__ = "{current_version}"'

setup.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
1-
import os
2-
import os.path as op
3-
from glob import glob
4-
from pathlib import Path
5-
6-
from setuptools import find_packages
71
from setuptools import setup
82

9-
init = Path().joinpath("github_activity", "__init__.py")
10-
for line in init.read_text().split("\n"):
11-
if line.startswith("__version__ ="):
12-
version = line.split(" = ")[-1].strip('"')
13-
break
14-
15-
# Source dependencies from requirements.txt file.
16-
with open("requirements.txt", "r") as f:
17-
lines = f.readlines()
18-
install_packages = [line.strip() for line in lines]
19-
20-
setup(
21-
name="github_activity",
22-
version=version,
23-
include_package_data=True,
24-
python_requires=">=3.9",
25-
author="Executable Books Project",
26-
author_email="[email protected]",
27-
url="https://executablebooks.org/",
28-
project_urls={
29-
"Source": "https://github.com/executablebooks/github-activity/",
30-
},
31-
# this should be a whitespace separated string of keywords, not a list
32-
keywords="development changelog",
33-
description="Grab recent issue/PR activity from a GitHub repository and render it as markdown.",
34-
long_description=open("./README.md", "r").read(),
35-
long_description_content_type="text/markdown",
36-
license="BSD",
37-
packages=find_packages(),
38-
use_package_data=True,
39-
entry_points={
40-
"console_scripts": [
41-
"github-activity = github_activity.cli:main",
42-
]
43-
},
44-
install_requires=install_packages,
45-
extras_require={
46-
"testing": ["pytest", "pytest-regressions"],
47-
"sphinx": ["sphinx", "myst_parser", "sphinx_book_theme"],
48-
},
49-
)
3+
setup()

0 commit comments

Comments
 (0)