Skip to content

Commit

Permalink
Ensure that utest and JSON test data are included in sdist.
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonmessmer committed Mar 24, 2021
1 parent 922797e commit a65d7d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MANIFEST.in
Expand Up @@ -8,5 +8,9 @@ include tests/test_data/*.gz
include tests/test_data/*.whl
include tests/test_data/*.zip
include tests/test_data/*.egg
include tests/test_data/*.json
exclude tests/test_data/utest*.gz
include tests/test_data/utest/*.py
include tests/test_data/utest/utest/*.py
include tests/test_data/LICENSE
include pyp2rpm.1
16 changes: 16 additions & 0 deletions setup.py
Expand Up @@ -4,6 +4,7 @@
from pyp2rpm.version import version

from setuptools import setup
from setuptools.command.build_py import build_py as _build_py


description = """Convert Python packages to RPM SPECFILES. The packages can be downloaded from
Expand All @@ -13,7 +14,22 @@
source and metadata can be extracted from PyPI or from local filesystem (local file doesn't
provide that much information though)."""

class build_py(_build_py):
def run(self):
# Run the normal build process
_build_py.run(self)
# Build test data
from subprocess import call
from shutil import copy
call(['python3', 'setup.py', 'sdist'],
cwd='tests/test_data/utest')
copy('tests/test_data/utest/dist/utest-0.1.0.tar.gz',
'tests/test_data/')

setup(
cmdclass={
'build_py': build_py,
},
name='pyp2rpm',
version=version,
description="Convert Python packages to RPM SPECFILES",
Expand Down

0 comments on commit a65d7d9

Please sign in to comment.