setuptools: move stuff to declarative cfg if possible [skip ci]

We're down to just declaring the data files in python now.

setup.cfg can, uniquely, retrieve version info by trying to parse the
AST for simple assignments (which we use) instead of importing the
entire module.
pull/8513/head
Eli Schwartz 4 years ago committed by GitHub
parent 56a0e74d71
commit d4bdd8318b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      setup.cfg
  2. 15
      setup.py

@ -1,4 +1,6 @@
[metadata] [metadata]
name = meson
version = attr: mesonbuild.coredata.version
description = A high performance build system description = A high performance build system
author = Jussi Pakkanen author = Jussi Pakkanen
author_email = jpakkane@gmail.com author_email = jpakkane@gmail.com
@ -29,16 +31,24 @@ classifiers =
long_description = Meson is a cross-platform build system designed to be both as fast and as user friendly as possible. It supports many languages and compilers, including GCC, Clang, PGI, Intel, and Visual Studio. Its build definitions are written in a simple non-Turing complete DSL. long_description = Meson is a cross-platform build system designed to be both as fast and as user friendly as possible. It supports many languages and compilers, including GCC, Clang, PGI, Intel, and Visual Studio. Its build definitions are written in a simple non-Turing complete DSL.
[options] [options]
packages = find:
python_requires = >= 3.6 python_requires = >= 3.6
setup_requires = setup_requires =
setuptools setuptools
[options.entry_points]
console_scripts =
meson = mesonbuild.mesonmain:main
[options.extras_require] [options.extras_require]
progress = progress =
tqdm tqdm
[options.packages.find]
include = mesonbuild, mesonbuild.*
exclude = *.data
[tool:pytest] [tool:pytest]
python_classes = python_classes =
python_files = python_files =
run_unittests.py run_unittests.py

@ -20,23 +20,12 @@ if sys.version_info < (3, 6):
raise SystemExit('ERROR: Tried to install Meson with an unsupported Python version: \n{}' raise SystemExit('ERROR: Tried to install Meson with an unsupported Python version: \n{}'
'\nMeson requires Python 3.6.0 or greater'.format(sys.version)) '\nMeson requires Python 3.6.0 or greater'.format(sys.version))
from mesonbuild.coredata import version from setuptools import setup
from setuptools import setup, find_packages
# On windows, will create Scripts/meson.exe and Scripts/meson-script.py
# Other platforms will create bin/meson
entries = {'console_scripts': ['meson=mesonbuild.mesonmain:main']}
data_files = [] data_files = []
if sys.platform != 'win32': if sys.platform != 'win32':
# Only useful on UNIX-like systems # Only useful on UNIX-like systems
data_files = [('share/man/man1', ['man/meson.1']), data_files = [('share/man/man1', ['man/meson.1']),
('share/polkit-1/actions', ['data/com.mesonbuild.install.policy'])] ('share/polkit-1/actions', ['data/com.mesonbuild.install.policy'])]
setup(name='meson', setup(data_files=data_files,)
version=version,
packages=find_packages(
include=['mesonbuild', 'mesonbuild.*'],
exclude=['*.data']
),
entry_points=entries,
data_files=data_files,)

Loading…
Cancel
Save