Skip to content

Commit 91fee79

Browse files
committed
setup.py: transition to setuptools
Also reformat it for black&flake8, and get the version number from the VERSION file. Change-Id: I5495a88f75bae224a21e4a125af4b4869b38727a TN: V707-013
1 parent 430a77d commit 91fee79

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
out
33
tmp*
44
gnatpython
5+
*.egg-info
6+
build

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ repos:
44
hooks:
55
- id: black
66
types: [file]
7-
files: ^gnatdbg/.*\.py$
7+
files: ^(gnatdbg/|setup).*\.py$
88
args: [--line-length=79]
99
- repo: https://github.com/pycqa/flake8
1010
rev: 4.0.1
1111
hooks:
1212
- id: flake8
1313
types: [file]
14-
files: ^gnatdbg/.*\.py$
14+
files: ^(gnatdbg/|setup).*\.py$
1515
additional_dependencies:
1616
- flake8-bugbear
1717
- flake8-builtins

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
23.0

setup.py

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
#! /usr/bin/env python
22

3-
from distutils.core import setup
3+
import os.path
44

5+
from setuptools import setup
56

6-
setup(
7-
name='GNATdbg',
8-
version='0.1-dev',
9-
author='AdaCore',
10-
author_email='[email protected]',
11-
url='https://github.com/AdaCore/gnat-gdb-scripts',
12-
description='Python helpers in GDB to deal with the GNAT runtime for Ada',
13-
packages=['gnatdbg'],
147

8+
# The actual version is stored in a separate file to ease automatic updates
9+
version_file = os.path.join(os.path.dirname(__file__), "VERSION")
10+
with open(version_file) as f:
11+
version = f.read().strip()
12+
13+
14+
setup(
15+
name="GNATdbg",
16+
version=version,
17+
author="AdaCore",
18+
author_email="[email protected]",
19+
url="https://github.com/AdaCore/gnat-gdb-scripts",
20+
description="Python helpers in GDB to deal with the GNAT runtime for Ada",
21+
packages=["gnatdbg"],
1522
# This requires to be run in GDB's embedded Python interpreter
1623
requires=[],
1724
)

0 commit comments

Comments
 (0)