Skip to content

Commit fabbd99

Browse files
committed
Using pyproject.toml to build packages, added --version option
1 parent 9bc335d commit fabbd99

File tree

6 files changed

+47
-28
lines changed

6 files changed

+47
-28
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ share/python-wheels/
2525
.installed.cfg
2626
*.egg
2727
MANIFEST
28+
_version.py
2829

2930
# PyInstaller
3031
# Usually these files are written by a python script from a template

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ no changes added to commit (use "git add" and/or "git commit -a")
3636

3737
Either install the pre-built .whl package from my github:
3838
```commandline
39-
wget https://github.com/stefanhepp/gitall/releases/download/gitall-1.0.0/gitall-1.0.0-py3-none-any.whl
40-
pip install gitall-1.0.0-py3-none-any.whl
39+
wget https://github.com/stefanhepp/gitall/releases/download/gitall-1.0.0/gitall-1.1.0-py3-none-any.whl
40+
pip install gitall-1.1.0-py3-none-any.whl
4141
```
4242
Or install from sources (any of the following commands):
4343
```commandline
@@ -72,4 +72,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7272
GNU General Public License for more details.
7373

7474
You should have received a copy of the GNU General Public License
75-
along with this program. If not, see <https://www.gnu.org/licenses/>.
75+
along with this program. If not, see <https://www.gnu.org/licenses/>.

gitall/gitall.py

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
import githelpers
1111

12+
try:
13+
from ._version import __version__
14+
except ImportError:
15+
# running directly from git, no version
16+
__version__ = "not-installed"
17+
1218

1319
class Config:
1420
def __init__(self):
@@ -229,6 +235,7 @@ def main():
229235
help="Check and print the status of the repositories (default: True).")
230236
parser.add_argument("-a", "--abort", action=argparse.BooleanOptionalAction, default=False, dest="abort_on_error",
231237
help="Abort on first git command error (default: False).")
238+
parser.add_argument("-V", "--version", action="version", version='%(prog)s {version}'.format(version=__version__))
232239
parser.add_argument("command", metavar="command", type=str, nargs=argparse.REMAINDER)
233240

234241
args = parser.parse_args()

pyproject.toml

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
11
[build-system]
2+
requires = ["setuptools", "setuptools-scm"]
23
build-backend = "setuptools.build_meta"
3-
requires = ["setuptools", "wheel"]
4+
5+
[project]
6+
name = "gitall"
7+
authors = [
8+
{name = "Stefan Hepp", email = "[email protected]"},
9+
]
10+
description = "A tool to show the status and run git commands over multiple git repositories."
11+
readme = "README.md"
12+
requires-python = ">=3.7"
13+
keywords = ["gitall"]
14+
license = {text = "GPL-3"}
15+
dependencies = [
16+
"colorama",
17+
]
18+
classifiers = [
19+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
20+
"Programming Language :: Python :: 3",
21+
"Topic :: Software Development :: Version Control :: Git"
22+
]
23+
dynamic = ["version"]
24+
25+
[project.urls]
26+
Homepage = "https://github.com/stefanhepp/gitall/"
27+
Repository = "https://github.com/stefanhepp/gitall/"
28+
29+
[project.scripts]
30+
gitall = "gitall.gitall:main"
31+
32+
[tool.setuptools]
33+
# Define python modules to package
34+
packages = ["gitall", "githelpers"]
35+
36+
[tool.setuptools_scm]
37+
# setuptools_scm 8.x changed this to 'version_file', but Debian still uses 7.x
38+
write_to = "gitall/_version.py"

setup.cfg

-19
This file was deleted.

setup.py

-5
This file was deleted.

0 commit comments

Comments
 (0)