diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c015ba..29631fb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,39 +1,39 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.4.0 hooks: - id: trailing-whitespace - id: flake8 - id: check-json - id: check-yaml - repo: https://github.com/codespell-project/codespell rev: v1.16.0 hooks: - id: codespell - repo: local hooks: - id: mypy name: mypy entry: mypy - args: [swh] + args: [pristine_zip] pass_filenames: false language: system types: [python] # unfortunately, we are far from being able to enable this... # - repo: https://github.com/PyCQA/pydocstyle.git # rev: 4.0.0 # hooks: # - id: pydocstyle # name: pydocstyle # description: pydocstyle is a static analysis tool for checking compliance with Python docstring conventions. # entry: pydocstyle --convention=google # language: python # types: [python] - repo: https://github.com/python/black rev: 19.10b0 hooks: - id: black diff --git a/AUTHORS b/AUTHORS index c329086..61d9aa9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,3 @@ -Copyright (C) 2019 The Software Heritage developers +Copyright (C) 2020 The Software Heritage developers See http://www.softwareheritage.org/ for more information. diff --git a/MANIFEST.in b/MANIFEST.in index 807e2e9..4375b04 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include Makefile include requirements*.txt include version.txt include README.md -recursive-include swh py.typed +recursive-include pristine_zip py.typed diff --git a/Makefile b/Makefile deleted file mode 100644 index 524175c..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# Makefile driver for SWH Python modules. DO NOT CHANGE. -# You can add custom Makefile rules to Makefile.local - -include ../Makefile.python --include Makefile.local diff --git a/README.md b/README.md index 08b97d8..0b5bbc7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -swh-py-template -=============== +pristine-zip +============ -Python module template, used as skeleton to create new modules. +Like pristine-tar, but of ZIP files: regenerate a pristine upstream zipball +using only a small binary delta file and a revision control checkout of the +upstream branch. diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index c6cbb11..0000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ - (0.0.1-1) unstable; urgency=low - - * - - -- AUTHOR-NAME diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index 68a9ef5..0000000 --- a/debian/control +++ /dev/null @@ -1,19 +0,0 @@ -Source: # example: swh-loader-pypi -Maintainer: Software Heritage developers -Section: python -Priority: optional -Build-Depends: debhelper (>= 9), - dh-python (>= 2), - python3-all, - python3-nose, - python3-setuptools, - python3-swh.core, - python3-swh.storage, - python3-vcversioner -Standards-Version: 3.9.6 -Homepage: https://forge.softwareheritage.org/source// - -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 deleted file mode 100644 index f216ea5..0000000 --- a/debian/copyright +++ /dev/null @@ -1,22 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ - -Files: * -Copyright: 2019 The Software Heritage developers -License: GPL-3+ - -License: GPL-3+ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in `/usr/share/common-licenses/GPL-3'. diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 32f59e6..0000000 --- a/debian/rules +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/make -f - -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/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 58a761e..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -_build/ -apidoc/ -*-stamp diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index c30c50a..0000000 --- a/docs/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../swh-docs/Makefile.sphinx diff --git a/docs/_static/.placeholder b/docs/_static/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/docs/_templates/.placeholder b/docs/_templates/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 190deb7..0000000 --- a/docs/conf.py +++ /dev/null @@ -1 +0,0 @@ -from swh.docs.sphinx.conf import * # NoQA diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index b04a56d..0000000 --- a/docs/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. _swh-py-template: - -Software Heritage - Python module template -========================================== - -Python module template, used as skeleton to create new modules. - - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/requirements-swh.txt b/requirements-swh.txt deleted file mode 100644 index 24f0a5c..0000000 --- a/requirements-swh.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Add here internal Software Heritage dependencies, one per line. -swh.core diff --git a/requirements.txt b/requirements.txt index 151b926..dca9a90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1 @@ -# Add here external Python modules dependencies, one per line. Module names -# should match https://pypi.python.org/pypi names. For the full spec or -# dependency lines, see https://pip.readthedocs.org/en/1.1/requirements.html -vcversioner +click diff --git a/setup.py b/setup.py index cadfc8a..2e65d46 100755 --- a/setup.py +++ b/setup.py @@ -1,74 +1,74 @@ #!/usr/bin/env python3 # Copyright (C) 2019 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 from setuptools import setup, find_packages from os import path from io import open here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read() def parse_requirements(name=None): if name: reqf = "requirements-%s.txt" % name else: reqf = "requirements.txt" requirements = [] if not 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.", # example: swh.loader.pypi - description="Software Heritage ", + name="pristine-zip", + description=( + "Regenerates a pristine upstream zipball using only a small binary " + "delta file and a revision control checkout of the upstream branch." + ), long_description=long_description, long_description_content_type="text/markdown", python_requires=">=3.7", author="Software Heritage developers", author_email="swh-devel@inria.fr", - url="https://forge.softwareheritage.org/diffusion/", + url="https://forge.softwareheritage.org/diffusion/pristine-zip", packages=find_packages(), # packages's modules - install_requires=parse_requirements() + parse_requirements("swh"), + install_requires=parse_requirements(), tests_require=parse_requirements("test"), - setup_requires=["vcversioner"], + setup_requires=["setuptools-scm"], + use_scm_version=True, extras_require={"testing": parse_requirements("test")}, - vcversioner={}, include_package_data=True, entry_points=""" - [swh.cli.subcommands] - =swh..cli:cli + [console_scripts] + pristine-zip=pristine_zip.main:main """, classifiers=[ "Programming Language :: Python :: 3", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Development Status :: 3 - Alpha", ], project_urls={ "Bug Reports": "https://forge.softwareheritage.org/maniphest", "Funding": "https://www.softwareheritage.org/donate", - "Source": "https://forge.softwareheritage.org/source/swh-", - "Documentation": "https://docs.softwareheritage.org/devel/swh-/", + "Source": "https://forge.softwareheritage.org/source/pristine-zip", + "Documentation": "https://docs.softwareheritage.org/devel/pristine-zip", }, ) diff --git a/swh/__init__.py b/swh/__init__.py deleted file mode 100644 index e780381..0000000 --- a/swh/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from pkgutil import extend_path -from typing import Iterable - -__path__: Iterable[str] = extend_path(__path__, __name__) diff --git a/swh/foo/__init__.py b/swh/foo/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/swh/foo/bar.py b/swh/foo/bar.py deleted file mode 100644 index a86df5d..0000000 --- a/swh/foo/bar.py +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (C) 2019 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 diff --git a/swh/foo/cli.py b/swh/foo/cli.py deleted file mode 100644 index cd764e9..0000000 --- a/swh/foo/cli.py +++ /dev/null @@ -1,18 +0,0 @@ -import click - -from swh.core.cli import CONTEXT_SETTINGS - - -@click.group(name="foo", context_settings=CONTEXT_SETTINGS) -@click.pass_context -def cli(ctx): - """Foo main command. - """ - - -@cli.command() -@click.option("--bar", help="Something") -@click.pass_context -def bar(ctx, bar): - """Do something.""" - click.echo("bar") diff --git a/swh/foo/py.typed b/swh/foo/py.typed deleted file mode 100644 index 1242d43..0000000 --- a/swh/foo/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. diff --git a/swh/foo/tests/__init__.py b/swh/foo/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tox.ini b/tox.ini index 1ce126c..47c1609 100644 --- a/tox.ini +++ b/tox.ini @@ -1,35 +1,35 @@ [tox] envlist=black,flake8,mypy,py3 [testenv] extras = testing deps = pytest-cov commands = pytest --doctest-modules \ - {envsitepackagesdir}/swh/foo \ - --cov={envsitepackagesdir}/swh/foo \ + {envsitepackagesdir}/pristine_zip \ + --cov={envsitepackagesdir}/pristine_zip \ --cov-branch {posargs} [testenv:black] skip_install = true deps = black commands = - {envpython} -m black --check swh + {envpython} -m black --check pristine_zip [testenv:flake8] skip_install = true deps = flake8 commands = {envpython} -m flake8 [testenv:mypy] extras = testing deps = mypy commands = - mypy swh + mypy pristine_zip