From cf5f693da32a956f0d70d9849f9a79b8b55c4e03 Mon Sep 17 00:00:00 2001 From: Darren Eberly Date: Sun, 21 Feb 2021 01:00:04 -0500 Subject: [PATCH] Update to support pep517 for building --- make.bat | 130 ------------------------------------------------- make.sh | 15 ------ pyproject.toml | 3 ++ setup.cfg | 29 ++++++++++- 4 files changed, 30 insertions(+), 147 deletions(-) delete mode 100644 make.bat delete mode 100755 make.sh create mode 100644 pyproject.toml diff --git a/make.bat b/make.bat deleted file mode 100644 index 1f857e6..0000000 --- a/make.bat +++ /dev/null @@ -1,130 +0,0 @@ -@echo off - -rem Build script for Windows - -IF "%~1"=="" GOTO printdoc -IF "%~1"=="full" GOTO makefull -IF "%~1"=="dist" GOTO makedist -IF "%~1"=="test" GOTO test -IF "%~1"=="testcov" GOTO test -IF "%~1"=="fast" GOTO makefast -IF "%~1"=="docs" GOTO makedoc -IF "%~1"=="spelling" GOTO spelling -IF "%~1"=="deploy_pypi" GOTO deploy_pypi -IF "%~1"=="clean" GOTO clean -GOTO printdoc - -:clean - -rmdir /S /Q pytiled_parser.egg-info -rmdir /S /Q build -rmdir /S /Q dist -rmdir /S /Q .pytest_cache -rmdir /S /Q doc\build - -GOTO end - -:test - -pytest -GOTO end - -:testcov - -pytest --cov=arcade -GOTO end - -:makedist - -rem Clean out old builds -del /q dist\*.* -python setup.py clean - -rem Build the python -python setup.py build -python setup.py bdist_wheel - -GOTO end - -:makefull -rem -- This builds the project, installs it, and runs unit tests - -rem Clean out old builds -rmdir /s /q "doc\build" -del /q dist\*.* -python setup.py clean - -rem Build the python -python setup.py build -python setup.py bdist_wheel - -rem Install the packages -pip uninstall -y arcade -for /r %%i in (dist\*) do pip install "%%i" - -rem Build the documentation -sphinx-build -b html doc doc/build/html - -rem Run tests and do code coverage -coverage run --source arcade setup.py test -coverage report --omit=arcade/examples/* -m - -GOTO end - -rem -- Make the documentation - -:makedoc - -rmdir /s /q "doc\build" -sphinx-build -n -b html doc doc/build/html - -GOTO end - -rem -- Make the documentation - -:spelling - -rmdir /s /q "doc\build" -sphinx-build -n -b spelling doc doc/build/html - -GOTO end - - -rem == This does a fast build and install, but no unit tests - -:makefast - -python setup.py build -python setup.py bdist_wheel -pip uninstall -y pytiled_parser -for /r %%i in (dist\*) do pip install "%%i" - -GOTO end - -rem -- Deploy - -:deploy_pypi -rem Do a "pip install twine" and set environment variables before running. - -twine upload -u %PYPI_USER% -p %PYPI_PASSWORD% -r pypi dist/* - -GOTO end - - - -rem -- Print documentation - -:printdoc - -echo make test - Runs the tests -echo make testcov - Runs the tests with coverage -echo make dist - Make the distributables -echo make full - Builds the project, installs it, builds -echo documentation, runs unit tests. -echo make docs Builds the documentation. Documentation -echo will be in doc/build/html -echo make fast - Builds and installs the library WITHOUT unit -echo tests. -echo make deploy_pypi - Deploy to PyPi (if you have environment -echo variables set up correctly.) -:end \ No newline at end of file diff --git a/make.sh b/make.sh deleted file mode 100755 index 5ae6d85..0000000 --- a/make.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -rm -rf doc/build -rm dist/* -python3 setup.py clean -python3 setup.py build -python3 setup.py bdist_wheel -pip3 uninstall -y pytiled_parser -for file in dist/* -do - pip3 install $file -done -# sphinx-build -b html doc doc/build/html -coverage run --source pytiled_parser setup.py test -coverage report -m diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..07de284 --- /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/setup.cfg b/setup.cfg index 89a2ebb..50c3441 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,9 @@ classifiers = Topic :: Software Development :: Libraries :: Python Modules [options] -python_requires = ~=3.6 +packages = find: +include_package_data = True +python_requires = >=3.6 setup_requires = setuptools >= 40.6 pip >= 10 @@ -26,8 +28,13 @@ install_requires = attrs typing-extensions +[options.packages.find] +include = + pytiled_parser + pytiled_parser.* + [options.extras_require] -tests = +dev = pytest pytest-cov black @@ -35,6 +42,24 @@ tests = mypy isort<5,>=4.2.5 +build = + pep517 + +docs = + sphinx + sphinx_rtd_theme + +[build_sphinx] +source-dir = docs +build-dir = docs/build +all_files = 1 + +[upload-sphinx] +upload-dir = docs/build/html + +[bdist_wheel] +universal=0 + [coverage:run] branch = True