Skip to content

Commit

Permalink
tox cleanup to get tox run almost clean (numpy handler test is leaking)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfletch committed Aug 29, 2022
1 parent edea11d commit c7345e6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
40 changes: 23 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@
"""PyOpenGL setup script (setuptools-based)
"""
import sys, os

extra_commands = {}

from setuptools import setup

from distutils.command.install_data import install_data


class smart_install_data(install_data):
def run(self):
#need to change self.install_dir to the library dir
install_cmd = self.get_finalized_command('install')
self.install_dir = getattr(install_cmd, 'install_lib')
# need to change self.install_dir to the library dir
install_cmd = self.get_finalized_command("install")
self.install_dir = getattr(install_cmd, "install_lib")
# should create the directory if it doesn't exist!!!
return install_data.run(self)
extra_commands['install_data'] = smart_install_data

if sys.platform == 'win32':

extra_commands["install_data"] = smart_install_data

if sys.platform == "win32":
# binary versions of GLUT and GLE for Win32 (sigh)
DLL_DIRECTORY = os.path.join('OpenGL','DLLS')
DLL_DIRECTORY = os.path.join("OpenGL", "DLLS")
datafiles = [
(
DLL_DIRECTORY, [
os.path.join( DLL_DIRECTORY,file)
for file in os.listdir( DLL_DIRECTORY )
if os.path.isfile( os.path.join( DLL_DIRECTORY,file) )
]
DLL_DIRECTORY,
[
os.path.join(DLL_DIRECTORY, file)
for file in os.listdir(DLL_DIRECTORY)
if os.path.isfile(os.path.join(DLL_DIRECTORY, file))
],
),
]
else:
Expand All @@ -34,12 +40,12 @@ def run(self):

if __name__ == "__main__":
setup(
options = {
'sdist': {
'formats': ['gztar'],
'force_manifest': True,
options={
"sdist": {
"formats": ["gztar"],
"force_manifest": True,
},
},
data_files = datafiles,
cmdclass = extra_commands,
data_files=datafiles,
cmdclass=extra_commands,
)
1 change: 0 additions & 1 deletion test-requirements.rst

This file was deleted.

4 changes: 4 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tox
pytest
pygame
psutil
9 changes: 4 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ passenv =
HOME
USER
deps=
pygame
pytest
psutil
pip
-Ur{toxinidir}/test-requirements.txt
num1: numpy
accel1: ./accelerate
#install_command = pip install -I {opts} {packages}
commands=
accel1: pytest -sv -rxXs {posargs:tests/ accelerate/tests}
accel0: pytest -sv -rxXs {posargs:tests/}
accel1: python -m pytest -sv -rxXs {posargs:tests/ accelerate/tests}
accel0: python -m pytest -sv -rxXs {posargs:tests/}

0 comments on commit c7345e6

Please sign in to comment.