diff --git a/AUTHORS b/AUTHORS --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,3 @@ -Copyright (C) 2015-2016 The Software Heritage developers +Copyright (C) 2018 The Software Heritage developers See http://www.softwareheritage.org/ for more information. diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: +Source: # example: swh-loader-pypi Maintainer: Software Heritage developers Section: python Priority: optional @@ -13,7 +13,7 @@ Standards-Version: 3.9.6 Homepage: https://forge.softwareheritage.org/source// -Package: python3- +Package: python3- # example: python3-swh.loader.pypi Architecture: all Depends: ${misc:Depends}, ${python3:Depends} Description: Software Heritage diff --git a/debian/copyright b/debian/copyright --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Files: * -Copyright: 2015 The Software Heritage developers +Copyright: 2015-2018 The Software Heritage developers License: GPL-3+ License: GPL-3+ diff --git a/debian/rules b/debian/rules --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,11 @@ #!/usr/bin/make -f -export PYBUILD_NAME= +export PYBUILD_NAME= # example: swh.loader.pypi export PYBUILD_TEST_ARGS=--with-doctest -sva !db,!fs %: dh $@ --with python3 --buildsystem=pybuild + +override_dh_install: + dh_install + rm -v $(CURDIR)/debian/python3-*/usr/lib/python*/dist-packages/swh/__init__.py diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1 @@ +nose diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 --- a/setup.py +++ b/setup.py @@ -1,29 +1,41 @@ -from setuptools import setup +#!/usr/bin/env python3 +import os + +from setuptools import setup, find_packages + + +def parse_requirements(name=None): + if name: + reqf = 'requirements-%s.txt' % name + else: + reqf = 'requirements.txt' -def parse_requirements(): requirements = [] - for reqf in ('requirements.txt', 'requirements-swh.txt'): - with open(reqf) as f: - for line in f.readlines(): - line = line.strip() - if not line or line.startswith('#'): - continue - requirements.append(line) + if not os.path.exists(reqf): + return requirements + + with open(reqf) as f: + for line in f.readlines(): + line = line.strip() + if not line or line.startswith('#'): + continue + requirements.append(line) return requirements # Edit this part to match your module # full sample: https://forge.softwareheritage.org/diffusion/DCORE/browse/master/setup.py setup( - name='swh.', + name='swh.', # example: swh.loader.pypi description='Software Heritage ', author='Software Heritage developers', author_email='swh-devel@inria.fr', url='https://forge.softwareheritage.org/diffusion/', - packages=[], # packages's modules + packages=find_packages(), # packages's modules scripts=[], # scripts to package - install_requires=parse_requirements(), + install_requires=parse_requirements() + parse_requirements('swh'), + test_requires=parse_requirements('test'), setup_requires=['vcversioner'], vcversioner={}, include_package_data=True, diff --git a/swh/foo/bar.py b/swh/foo/bar.py --- a/swh/foo/bar.py +++ b/swh/foo/bar.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2016 The Software Heritage developers +# Copyright (C) 2015-2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information