Transition to PEP517 buildsystem

Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate 2023-11-14 20:35:49 +02:00
parent bae87b0877
commit cc2d715b6d
No known key found for this signature in database
GPG Key ID: A12750536B5E7010
2 changed files with 27 additions and 48 deletions

26
pyproject.toml Normal file
View File

@ -0,0 +1,26 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "euscan-ng"
authors = [
{name = "Corentin Chary", email = "corentin.chary@gmail.com"}
]
maintainers = [
{name = "src_prepare group"}
]
description = "Ebuild upstream scan utility."
readme = "README.rst"
license = {text = "GPL-2.0"}
dependencies = [
"portage",
"beautifulsoup4>=4.8.2"
]
dynamic = ["version"]
[project.urls]
homepage = "https://gitlab.com/src_prepare/euscan-ng"
[tool.setuptools]
script-files = ["bin/euscan"]

View File

@ -1,27 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python
from setuptools import setup, Command
"""
Python setup script
"""
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
from glob import glob
import io import io
import os import os
import re import re
import sys
from os.path import join, dirname
from distutils import log
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
__version__ = os.getenv('VERSION', default='9999') __version__ = os.getenv('VERSION', default='9999')
@ -69,38 +52,8 @@ class SetVersion(Command):
python_re = r'(?<=^__version__ = )' + quote + '[^\'"]*' + quote python_re = r'(?<=^__version__ = )' + quote + '[^\'"]*' + quote
sub(python_scripts, python_re) sub(python_scripts, python_re)
packages = [
str('.'.join(root.split(os.sep)[1:]))
for root, dirs, files in os.walk('src/euscan')
if '__init__.py' in files
]
setup( setup(
name='euscan',
version=__version__, version=__version__,
description='Ebuild upstream scan utility.',
long_description=open(join(dirname(__file__), 'README.rst')).read(),
author='src_prepare',
maintainer='src_prepare',
url='https://gitlab.com/src_prepare/euscan-ng',
download_url=(
'https://github.com/iksaif/euscan/tarball/' +
('master' if __version__ == '9999' else ('euscan-%s' % __version__))
),
install_requires=[
# Command line utility
'beautifulsoup4>=4.8.2',
],
package_dir={'': 'src'},
packages=packages,
package_data={},
scripts=python_scripts,
# enable user install
# data_files=(
# (os.path.join(os.sep, EPREFIX.lstrip(os.sep), 'usr/share/man/man1'),
# glob('man/*')),
# ),
cmdclass={ cmdclass={
'set_version': SetVersion, 'set_version': SetVersion,
}, },