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

adding sdist check so we don't deploy broken sdists accidentally #918

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion python/perspective/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from __future__ import print_function
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
from setuptools.command.sdist import sdist
from distutils.version import LooseVersion
from distutils import sysconfig
from codecs import open
Expand Down Expand Up @@ -205,6 +206,18 @@ def build_extension_cmake(self, ext):
print() # Add an empty line for cleaner output


class PSPCheckSDist(sdist):
def run(self):
self.run_check()
super(PSPCheckSDist, self).run()

def run_check(self):
for file in ('CMakeLists.txt', 'cmake', 'src', 'test'):
path = os.path.abspath(os.path.join(here, 'dist', file))
if not os.path.exists(path):
raise Exception("Path is missing! {}\nMust run `yarn build_python` before building sdist so cmake files are installed".format(path))


setup(
name='perspective-python',
version=version,
Expand Down Expand Up @@ -234,5 +247,5 @@ def build_extension_cmake(self, ext):
'dev': requires_dev,
},
ext_modules=[PSPExtension('perspective')],
cmdclass=dict(build_ext=PSPBuild),
cmdclass=dict(build_ext=PSPBuild, sdist=PSPCheckSDist),
)