From 36d2c5ce5514e0ed21517ea270f677fecb6347aa Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Tue, 1 Oct 2024 20:13:39 -0400 Subject: [PATCH] BUILD Attempts to get cleaner/more-modern build setup --- numpy-requirements.txt | 2 ++ pyproject.toml | 49 +++++++++++++++++++++++++++++++++++++++++- setup.cfg | 2 +- test-requirements.txt | 5 +++-- tox.ini | 4 ++-- 5 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 numpy-requirements.txt diff --git a/numpy-requirements.txt b/numpy-requirements.txt new file mode 100644 index 00000000..1605f044 --- /dev/null +++ b/numpy-requirements.txt @@ -0,0 +1,2 @@ +numpy >= 2; python_version >= '3.9' +numpy < 2; python_version < '3.9' diff --git a/pyproject.toml b/pyproject.toml index 92fc6eab..cbfd7a92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,58 @@ +[project] +name="PyOpenGL" +dynamic=["version"] +description = "Standard OpenGL bindings for Python" +authors = [ + {name="Mike C. Fletcher",email="mcfletch@vrplumber.com"}, +] +readme = {file="readme.rst", content-type = "text/x-rst"} +keywords = [ + "Graphics", + "3D", + "OpenGL", + "GLU", + "GLUT", + "GLE", + "GLX", + "EXT", + "ARB", + "Mesa", + "ctypes", +] +classifiers = [ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 3", + "Topic :: Multimedia :: Graphics :: 3D Rendering", + "Topic :: Software Development :: Libraries :: Python Modules", + "Intended Audience :: Developers", +] + +[project.urls] +Homepage = "https://mcfletch.github.io/pyopengl/" +Download = "https://pypi.org/project/PyOpenGL/" +Source = "https://github.com/mcfletch/pyopengl" +Documentation = "https://mcfletch.github.io/pyopengl/documentation/index.html" + [build-system] requires = [ "setuptools >= 42.0" ] build-backend = "setuptools.build_meta" +[tool.setuptools.dynamic] +version = {attr = "OpenGL.version.__version__"} + +[tool.setuptools.packages.find] +namespaces=false +include=["OpenGL"] +exclude=["tests","accelerate","directdocs","documentation"] + + [tool.black] skip-string-normalization=true [tool.ruff.lint] +dummy-variable-rgx="^(_|err)$" ignore = [ 'D200', # Allow multiline docstring even when it could fit on one line @@ -15,7 +62,7 @@ ignore = [ 'PTH', # allow os.path 'PLR0913', # allow too many arguments - 'F841', # we often have `err` as unused argument in this codebase + # 'F841', # we often have `err` as unused argument in this codebase 'E401', # I prefer multiple imports/line generally 'E402', # Common pattern with autogenerated boilerplate in the wrappers 'F401', # Unused imports from autogeneration are everywhere diff --git a/setup.cfg b/setup.cfg index 6fe3e154..21031f97 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ author = Mike C. Fletcher author_email = mcfletch@vrplumber.com url = http://pyopengl.sourceforge.net download_url = https://pypi.org/project/PyOpenGL/ -license = BSD +; license = BSD long_description = file: readme.rst long_description_content_type = text/x-rst keywords = Graphics, 3D, OpenGL, GLU, GLUT, GLE, GLX, EXT, ARB, Mesa, ctypes diff --git a/test-requirements.txt b/test-requirements.txt index be33ae71..4936211f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,7 @@ tox pip >= 23 ; python_version >= '3.12' pytest -pygame; python_version < '3.11' -pygame >= '2.1.3.dev8'; python_version >= '3.11' +pygame < 2.1.3; python_version < '3.11' +pygame >= 2.1.3; python_version >= '3.11' +--only-binary pygame psutil diff --git a/tox.ini b/tox.ini index cd492fe0..7a2bb3e9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py{312,311,310,39,27,37,38}-num{0,1}-accel{0,1} +envlist=py{313,312,311,310,39,27,37,38}-num{0,1}-accel{0,1} skip_missing_interpreters=True [testenv] whitelistcommands=accel.sh @@ -12,7 +12,7 @@ passenv = USER deps= -r{toxinidir}/test-requirements.txt - num1: numpy + num1: -r{toxinidir}/numpy-requirements.txt accel1: ./accelerate #install_command = pip install -I {opts} {packages} commands=