From de1f4b481b405ff5742e86418c46962dfa3dc14b Mon Sep 17 00:00:00 2001 From: ades Date: Mon, 15 Nov 2021 22:43:57 +0100 Subject: [PATCH 1/6] Deprecate setup.py and requirements.txt --- pyproject.toml | 3 +++ requirements.txt | 27 ------------------------- setup.cfg | 49 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 52 ------------------------------------------------ 4 files changed, 52 insertions(+), 79 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..07de284a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 51f4d39c..00000000 --- a/requirements.txt +++ /dev/null @@ -1,27 +0,0 @@ -# For quick install of optional requirements in development -# Get the main requirements by installing the package in editable mode: -# pip install -e . - -moderngl<6 - -# Optional -pyglet<2 -PySide2<6 -PyQt5<6 -glfw<2 -PySDL2<1 -pygame==2.0.1 -pyrr>=0.10 -pywavefront>=1.2.0,<2.0 -numpy>=1.16 -imgui<2 - -# trimesh -trimesh>=3.2.6 -scipy>=1.3.2 - -# tkinter window -pyopengl>=3.1.0 -pyopengltk>=0.0.3 - -flake8 diff --git a/setup.cfg b/setup.cfg index b88034e4..2ad49d2b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,51 @@ [metadata] +name = moderngl-window +version = 2.4.0 +description = A cross platform helper library for ModernGL making window creation and resource loading simple description-file = README.md +long_description = file: README.md, CHANGELOG.md, LICENSE +long_description_content_type = text/markdown +url = https://github.com/moderngl/moderngl_window +author = Einar Forselv +author_email = eforselv@gmail.com +keywords = moderngl, window, context +license = MIT +classifiers = + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Topic :: Games/Entertainment + Topic :: Multimedia :: Graphics + Topic :: Multimedia :: Graphics :: 3D Rendering + Topic :: Scientific/Engineering :: Visualization + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + +[options] +zip_safe = False +include_package_data = True +packages = find_namespace: +install_requires = + moderngl<6 + pyglet>=1.5,<2 + numpy>=1.16,<2 + pyrr>=0.10.3,<1 + Pillow>=5 + +[options.packages.find] +include = + moderngl_window + moderngl_window.* + +[options.extras_require] +pdf = ReportLab>=1.2; RXP +PySide2 = PySide2<6 +pyqt5 = PyQt5 +glfw = glfw +PySDL2 = PySDL2 +pywavefront = pywavefront>=1.2.0,<2 +trimesh = trimesh>=3.2.6,<4 +tk = pyopengltk>=0.0.3 +pygame = pygame~=2.0.1 diff --git a/setup.py b/setup.py deleted file mode 100644 index f2dd777f..00000000 --- a/setup.py +++ /dev/null @@ -1,52 +0,0 @@ -from setuptools import setup, find_namespace_packages - -setup( - name="moderngl-window", - version="2.4.0", - description="A cross platform helper library for ModernGL making window creation and resource loading simple", - long_description=open('README.md').read(), - long_description_content_type='text/markdown', - url="https://github.com/moderngl/moderngl_window", - author="Einar Forselv", - author_email="eforselv@gmail.com", - packages=find_namespace_packages(include=['moderngl_window', 'moderngl_window.*']), - include_package_data=True, - keywords=['moderngl', 'window', 'context'], - license='MIT', - platforms=['any'], - python_requires='>=3.6', - classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Topic :: Games/Entertainment', - 'Topic :: Multimedia :: Graphics', - 'Topic :: Multimedia :: Graphics :: 3D Rendering', - 'Topic :: Scientific/Engineering :: Visualization', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - ], - install_requires=[ - 'moderngl<6', - 'pyglet>=1.5.8,<2', - 'numpy>=1.16,<2', - 'pyrr>=0.10.3,<1', - 'Pillow>=5', - ], - extras_require={ - "PySide2": ['PySide2<6'], - "pyqt5": ['PyQt5'], - "glfw": ['glfw'], - "PySDL2": ['PySDL2'], - "pywavefront": ["pywavefront>=1.2.0,<2"], - "trimesh": ["trimesh>=3.2.6,<4", "scipy>=1.3.2"], - "tk": ["pyopengltk>=0.0.3"], - "pygame": ["pygame~=2.0.1"], - }, - project_urls={ - 'Documentation': 'https://moderngl-window.readthedocs.io', - 'ModernGL': 'https://github.com/moderngl/moderngl', - }, -) From a6510945f36346187cc4d8c500db6b46516b7611 Mon Sep 17 00:00:00 2001 From: ades Date: Mon, 15 Nov 2021 22:52:07 +0100 Subject: [PATCH 2/6] Deprecate tests/requirements.txt --- .github/workflows/pythonpackage.yml | 12 ++---------- setup.cfg | 9 +++++++++ tests/requirements.txt | 4 ---- tox.ini | 15 ++++++++++----- 4 files changed, 21 insertions(+), 19 deletions(-) delete mode 100644 tests/requirements.txt diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b3213749..c38a70a4 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -1,15 +1,11 @@ name: Python package - on: [push] - jobs: build: - runs-on: ubuntu-latest strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] - steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -18,19 +14,15 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools - pip install -e .[pywavefront,trimesh] - pip install -r tests/requirements.txt - # pip install -r requirements.txt + python -m pip install --upgrade pip + pip install -e .[tests] - name: Lint with flake8 run: | - # pip install flake8 # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pip install pytest # TODO: Figure out if we can run headless tests pytest tests/test_docs.py diff --git a/setup.cfg b/setup.cfg index 2ad49d2b..f05a9206 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,3 +49,12 @@ pywavefront = pywavefront>=1.2.0,<2 trimesh = trimesh>=3.2.6,<4 tk = pyopengltk>=0.0.3 pygame = pygame~=2.0.1 +tests = + pytest + tox + tox-gh-actions + flake8 + coverage + pywavefront + trimesh + scipy diff --git a/tests/requirements.txt b/tests/requirements.txt deleted file mode 100644 index fad52503..00000000 --- a/tests/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest -tox -flake8 -coverage diff --git a/tox.ini b/tox.ini index 9612cd49..7034793b 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ # as flake8 can fail to parse the file on OS X and Windows [tox] -skipsdist = False +skipsdist = True envlist = py35 py36 @@ -10,6 +10,14 @@ envlist = py38 pep8 +[gh-actions] +python = + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 + pep8: py38 + [testenv] usedevelop = True basepython = @@ -17,10 +25,7 @@ basepython = py36: python3.6 py37: python3.7 py38: python3.8 - -deps = - -r{toxinidir}/requirements.txt - -r{toxinidir}/tests/requirements.txt +extras = tests commands = coverage run --source=moderngl_window -m pytest tests/ coverage report From 387733f66b0c4150c19740ea6b4011d735534909 Mon Sep 17 00:00:00 2001 From: ades Date: Tue, 16 Nov 2021 00:02:51 +0100 Subject: [PATCH 3/6] Deprecate docs/requirements.txt --- .readthedocs.yml | 18 ++++++++++-------- docs/requirements.txt | 4 ---- setup.cfg | 7 ++++++- 3 files changed, 16 insertions(+), 13 deletions(-) delete mode 100644 docs/requirements.txt diff --git a/.readthedocs.yml b/.readthedocs.yml index 9e75e357..ee0c51b2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,8 +1,10 @@ -build: - image: latest - -python: - version: 3.7 - setup_py_install: true - install: - - requirements: docs/requirements.txt +build: + image: latest + +python: + version: 3.7 + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 0dddbb45..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -Sphinx==2.2.0 -sphinx-rtd-theme==0.4.3 -sphinxcontrib-napoleon==0.7 -doc8 diff --git a/setup.cfg b/setup.cfg index f05a9206..daf4b53c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ include = moderngl_window.* [options.extras_require] -pdf = ReportLab>=1.2; RXP +pdf = ReportLab>=1.2 PySide2 = PySide2<6 pyqt5 = PyQt5 glfw = glfw @@ -58,3 +58,8 @@ tests = pywavefront trimesh scipy +docs = + Sphinx + sphinx-rtd-theme + sphinxcontrib-napoleon + doc8 From 9af69be4006bc7ffa80c3120f04fd7ee1ae8c2b6 Mon Sep 17 00:00:00 2001 From: ades Date: Tue, 16 Nov 2021 00:04:34 +0100 Subject: [PATCH 4/6] Update commands for installing extra deps --- README.md | 39 +++++++++++++++++++-------------------- setup.cfg | 3 +++ tox.ini | 9 ++++----- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index ad605d76..6c16f8d8 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ you provide us your `moderngl.Context`. ## Install ```bash -pip install moderngl-window +$ pip install moderngl-window ``` ## Supported Platforms @@ -67,13 +67,13 @@ Test.run() Run the example with different window backends: ```bash -python test.py --window pyglet -python test.py --window pygame2 -python test.py --window glfw -python test.py --window sdl2 -python test.py --window pyside2 -python test.py --window pyqt5 -python test.py --window tk +$ python test.py --window pyglet +$ python test.py --window pygame2 +$ python test.py --window glfw +$ python test.py --window sdl2 +$ python test.py --window pyside2 +$ python test.py --window pyqt5 +$ python test.py --window tk ``` `WindowConfig` classes are the simplest way to get started without knowing @@ -82,15 +82,14 @@ or examples. ## Setup from source -We assume the user knows how to handle vitrualenvs. +We assume the user knows how to handle virtualenvs. ```bash # Install the package in editable mode $ pip install -e . -# Set up and dev requirements -pip install -r requirements.txt -pip install -r tests/requirements.txt +# Install test and development requirements +$ pip install -e .[tests] ``` ## Running Tests @@ -98,19 +97,19 @@ pip install -r tests/requirements.txt Tests are set up with `tox` running pytest with coverage and flake8. ```bash -pip install -r tests/requirements.txt -tox -e py36 -tox -e py37 -tox -e py38 -tox -e py39 -tox -e pep8 +$ pip install -e .[tests] +$ tox -e py36 +$ tox -e py37 +$ tox -e py38 +$ tox -e py39 +$ tox -e pep8 ``` ## Building Docs ```bash -pip install -r docs/requirements.txt -python setup.py build_sphinx +$ pip install -e .[docs] +$ sphinx-build -b html docs docs/_build ``` ## Contributing diff --git a/setup.cfg b/setup.cfg index daf4b53c..1900b2fc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -63,3 +63,6 @@ docs = sphinx-rtd-theme sphinxcontrib-napoleon doc8 + +[coverage:run] +source = moderngl_window diff --git a/tox.ini b/tox.ini index 7034793b..56e3f595 100644 --- a/tox.ini +++ b/tox.ini @@ -4,30 +4,29 @@ [tox] skipsdist = True envlist = - py35 py36 py37 py38 + py39 pep8 [gh-actions] python = - 3.5: py35 3.6: py36 3.7: py37 3.8: py38 - pep8: py38 + 3.9: py39 [testenv] usedevelop = True basepython = - py35: python3.5 py36: python3.6 py37: python3.7 py38: python3.8 + py39: python3.9 extras = tests commands = - coverage run --source=moderngl_window -m pytest tests/ + coverage run -m pytest tests/ coverage report [testenv:pep8] From 69dbac06b3f6410a078cac09b0c85e529413b770 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 13 Oct 2023 20:25:03 +0200 Subject: [PATCH 5/6] Test change --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 07de284a..9787c3bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" From 598481e51141fec8b6f155f03fe2d0722ed0d5bb Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 13 Oct 2023 23:41:31 +0200 Subject: [PATCH 6/6] Merge setup.cfg into pyproject.toml --- pyproject.toml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 68 -------------------------------------------------- 2 files changed, 67 insertions(+), 68 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 9787c3bd..2987d193 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,70 @@ +[project] +name = "moderngl-window" +version = "2.4.4" +description = "A cross platform helper library for ModernGL making window creation and resource loading simple" +readme = "README.md" +authors = [ + {name="Einar Forselv", email="eforselv@gmail.com"} +] +requires-python = ">=3.8" +license = {file = "license.rst"} +classifiers = [ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Games/Entertainment", + "Topic :: Multimedia :: Graphics", + "Topic :: Multimedia :: Graphics :: 3D Rendering", + "Topic :: Scientific/Engineering :: Visualization", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +# zip-safe = false +dependencies = [ + "moderngl<6", + "pyglet~=2.0.0", + "numpy>=1.16,<2", + "pyrr>=0.10.3,<1", + "Pillow>=9,<10", +] + +[tool.setuptools.packages.find] +include = ["moderngl_window", "moderngl_window.*"] + +[project.optional-dependencies] +dev = [ + "pytest", + "mypy", + "flake8", + "coverage", +] +docs = [ + "Sphinx==2.2.0", + "sphinx-rtd-theme==0.4.3", + "sphinxcontrib-napoleon==0.7", + "doc8", +] +pygame = ["pygame>=2.0.1"] +pygame-ce = ["pygame-ce>=2.0.1"] +tk = ["pyopengltk>=0.0.3"] +trimesh = ["trimesh>=3.2.6,<4"] +pywavefront = ["pywavefront>=1.2.0,<2"] +PySDL2 = ["PySDL2"] +glfw = ["glfw"] +pyqt5 = ["PyQt5"] +PySide2 = ["PySide2<6"] +pdf = ["ReportLab>=1.2"] + +[project.urls] +Source = "https://github.com/moderngl/moderngl_window" +Documentation = "https://moderngl-window.readthedocs.io" +ModernGL = "https://github.com/moderngl/moderngl" + +[tool.coverage.run] +source = ["moderngl_window"] + [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1900b2fc..00000000 --- a/setup.cfg +++ /dev/null @@ -1,68 +0,0 @@ -[metadata] -name = moderngl-window -version = 2.4.0 -description = A cross platform helper library for ModernGL making window creation and resource loading simple -description-file = README.md -long_description = file: README.md, CHANGELOG.md, LICENSE -long_description_content_type = text/markdown -url = https://github.com/moderngl/moderngl_window -author = Einar Forselv -author_email = eforselv@gmail.com -keywords = moderngl, window, context -license = MIT -classifiers = - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Topic :: Games/Entertainment - Topic :: Multimedia :: Graphics - Topic :: Multimedia :: Graphics :: 3D Rendering - Topic :: Scientific/Engineering :: Visualization - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - -[options] -zip_safe = False -include_package_data = True -packages = find_namespace: -install_requires = - moderngl<6 - pyglet>=1.5,<2 - numpy>=1.16,<2 - pyrr>=0.10.3,<1 - Pillow>=5 - -[options.packages.find] -include = - moderngl_window - moderngl_window.* - -[options.extras_require] -pdf = ReportLab>=1.2 -PySide2 = PySide2<6 -pyqt5 = PyQt5 -glfw = glfw -PySDL2 = PySDL2 -pywavefront = pywavefront>=1.2.0,<2 -trimesh = trimesh>=3.2.6,<4 -tk = pyopengltk>=0.0.3 -pygame = pygame~=2.0.1 -tests = - pytest - tox - tox-gh-actions - flake8 - coverage - pywavefront - trimesh - scipy -docs = - Sphinx - sphinx-rtd-theme - sphinxcontrib-napoleon - doc8 - -[coverage:run] -source = moderngl_window