fix packaging/git/coverage for src/ path

This commit is contained in:
Thomas Waldmann 2016-05-05 20:59:53 +02:00
parent d1ea925a5b
commit 76839362e2
5 changed files with 28 additions and 24 deletions

View File

@ -1,6 +1,6 @@
[run]
branch = True
source = borg
source = src/borg
omit =
*/borg/__init__.py
*/borg/__main__.py

2
.gitignore vendored
View File

@ -17,7 +17,7 @@ platform_linux.c
*.so
.idea/
.cache/
borg/_version.py
src/borg/_version.py
borg.build/
borg.dist/
borg.exe

View File

@ -1,9 +1,10 @@
include README.rst AUTHORS LICENSE CHANGES.rst MANIFEST.in
recursive-include borg *.pyx
graft src
recursive-exclude src *.pyc
recursive-exclude src *.pyo
recursive-include docs *
recursive-exclude docs *.pyc
recursive-exclude docs *.pyo
prune docs/_build
prune .travis
exclude .coveragerc .gitattributes .gitignore .travis.yml Vagrantfile
include borg/_version.py

View File

@ -32,17 +32,17 @@ extras_require = {
'fuse': ['llfuse<2.0', ],
}
from setuptools import setup, Extension
from setuptools import setup, find_packages, Extension
from setuptools.command.sdist import sdist
compress_source = 'borg/compress.pyx'
crypto_source = 'borg/crypto.pyx'
chunker_source = 'borg/chunker.pyx'
hashindex_source = 'borg/hashindex.pyx'
platform_linux_source = 'borg/platform_linux.pyx'
platform_darwin_source = 'borg/platform_darwin.pyx'
platform_freebsd_source = 'borg/platform_freebsd.pyx'
compress_source = 'src/borg/compress.pyx'
crypto_source = 'src/borg/crypto.pyx'
chunker_source = 'src/borg/chunker.pyx'
hashindex_source = 'src/borg/hashindex.pyx'
platform_linux_source = 'src/borg/platform_linux.pyx'
platform_darwin_source = 'src/borg/platform_darwin.pyx'
platform_freebsd_source = 'src/borg/platform_freebsd.pyx'
try:
from Cython.Distutils import build_ext
@ -50,19 +50,19 @@ try:
class Sdist(sdist):
def __init__(self, *args, **kwargs):
for src in glob('borg/*.pyx'):
for src in glob('src/borg/*.pyx'):
cython_compiler.compile(src, cython_compiler.default_options)
super().__init__(*args, **kwargs)
def make_distribution(self):
self.filelist.extend([
'borg/compress.c',
'borg/crypto.c',
'borg/chunker.c', 'borg/_chunker.c',
'borg/hashindex.c', 'borg/_hashindex.c',
'borg/platform_linux.c',
'borg/platform_freebsd.c',
'borg/platform_darwin.c',
'src/borg/compress.c',
'src/borg/crypto.c',
'src/borg/chunker.c', 'src/borg/_chunker.c',
'src/borg/hashindex.c', 'src/borg/_hashindex.c',
'src/borg/platform_linux.c',
'src/borg/platform_freebsd.c',
'src/borg/platform_darwin.c',
])
super().make_distribution()
@ -258,7 +258,7 @@ class build_api(Command):
API Documentation
=================
""")
for mod in glob('borg/*.py') + glob('borg/*.pyx'):
for mod in glob('src/borg/*.py') + glob('src/borg/*.pyx'):
print("examining module %s" % mod)
mod = mod.replace('.pyx', '').replace('.py', '').replace('/', '.')
if "._" not in mod:
@ -294,7 +294,7 @@ if not on_rtd:
setup(
name='borgbackup',
use_scm_version={
'write_to': 'borg/_version.py',
'write_to': 'src/borg/_version.py',
},
author='The Borg Collective (see AUTHORS file)',
author_email='borgbackup@python.org',
@ -320,7 +320,10 @@ setup(
'Topic :: Security :: Cryptography',
'Topic :: System :: Archiving :: Backup',
],
packages=['borg', 'borg.testsuite', ],
packages=find_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
zip_safe=False,
entry_points={
'console_scripts': [
'borg = borg.archiver:main',

View File

@ -11,7 +11,7 @@ changedir = {toxworkdir}
deps =
-rrequirements.d/development.txt
attic
commands = py.test --cov=borg --cov-config=../.coveragerc --benchmark-skip --pyargs {posargs:borg.testsuite}
commands = py.test --cov=borg --cov-config=.coveragerc --benchmark-skip --pyargs {posargs:borg.testsuite}
# fakeroot -u needs some env vars:
passenv = *