Changeset View
Changeset View
Standalone View
Standalone View
setup.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (C) 2019-2021 The Software Heritage developers | # Copyright (C) 2019-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from io import open | from io import open | ||||
from os import path | from os import path | ||||
import sys | |||||
from setuptools import Extension, find_packages, setup | from setuptools import Extension, find_packages, setup | ||||
here = path.abspath(path.dirname(__file__)) | here = path.abspath(path.dirname(__file__)) | ||||
# Get the long description from the README file | # Get the long description from the README file | ||||
with open(path.join(here, "README.rst"), encoding="utf-8") as f: | with open(path.join(here, "README.rst"), encoding="utf-8") as f: | ||||
long_description = f.read() | long_description = f.read() | ||||
Show All 14 Lines | for name in names: | ||||
for line in f.readlines(): | for line in f.readlines(): | ||||
line = line.strip() | line = line.strip() | ||||
if not line or line.startswith("#"): | if not line or line.startswith("#"): | ||||
continue | continue | ||||
requirements.append(line) | requirements.append(line) | ||||
return requirements | return requirements | ||||
macros = [] | |||||
if sys.version_info[:2] >= (3, 10): # https://github.com/python/cpython/issues/85115 | |||||
macros.append(("PY_SSIZE_T_CLEAN", None)) | |||||
setup( | setup( | ||||
name="swh.loader.cvs", | name="swh.loader.cvs", | ||||
description="Software Heritage CVS Loader", | description="Software Heritage CVS Loader", | ||||
long_description=long_description, | long_description=long_description, | ||||
long_description_content_type="text/x-rst", | long_description_content_type="text/x-rst", | ||||
python_requires=">=3.7", | python_requires=">=3.7", | ||||
author="Software Heritage developers", | author="Software Heritage developers", | ||||
author_email="swh-devel@inria.fr", | author_email="swh-devel@inria.fr", | ||||
Show All 24 Lines | setup( | ||||
}, | }, | ||||
ext_modules=[ | ext_modules=[ | ||||
Extension( | Extension( | ||||
"swh.loader.cvs.rcsparse", | "swh.loader.cvs.rcsparse", | ||||
sources=[ | sources=[ | ||||
"swh/loader/cvs/rcsparse/py-rcsparse.c", | "swh/loader/cvs/rcsparse/py-rcsparse.c", | ||||
"swh/loader/cvs/rcsparse/rcsparse.c", | "swh/loader/cvs/rcsparse/rcsparse.c", | ||||
], | ], | ||||
define_macros=macros, | |||||
) | ) | ||||
], | ], | ||||
) | ) |