Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that utest and JSON test data are included in sdist. #264

Merged
merged 1 commit into from Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize I am a bit late here, but should this be sys.executable instead of 'python3'?

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