From 0d82509ce95edd2e740b1ca1821cfcc24da773fa Mon Sep 17 00:00:00 2001 From: Mark Lugar <14322382+araglu@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:38:26 -0600 Subject: [PATCH] Replace setup.py with pyproject.toml (#73) * Replace setup.py with pyproject.toml Also changes flake8 config to stop ignoring line length (E501). * Remove support for Python 3.7 In the debug logging, I use f-strings with "self-documenting expressions" which was added in Python 3.8. * Remove options from lint_and_format.yml Black and Flake8 will grab their configurations from pyproject.toml and tox.ini. * Fix source url --- .github/workflows/lint_and_format.yml | 5 +-- pyproject.toml | 61 +++++++++++++++++++++++++++ setup.py | 37 ---------------- tox.ini | 2 +- 4 files changed, 63 insertions(+), 42 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/lint_and_format.yml b/.github/workflows/lint_and_format.yml index 22baea2..615bb7b 100644 --- a/.github/workflows/lint_and_format.yml +++ b/.github/workflows/lint_and_format.yml @@ -21,9 +21,6 @@ jobs: python-version: "3.11" - name: flake8 Lint uses: py-actions/flake8@v2 - with: - ignore: "E203" - max-line-length: "120" format: needs: lint runs-on: ubuntu-latest @@ -32,4 +29,4 @@ jobs: - uses: actions/checkout@v4 - uses: psf/black@stable with: - options: "--check --line-length 120" \ No newline at end of file + options: "--check" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b67f583 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ["setuptools >= 64"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyuit" +version = "0.7.0" +description = "Python wrapper for DoD HPCMP UIT+ REST interface." + +authors = [ + {name = "Scott Christensen", email="scott.d.christensen@erdc.dren.mil"}, +] + +requires-python = ">= 3.8" +keywords = ["uit"] +dependencies = [ + "aiohttp", + "flask", + "PyYAML", + "requests", + "dodcerts", +] +readme = "README.md" + +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Scientific/Engineering :: Visualization", +] + +[project.optional-dependencies] +guitools = ['panel', 'param', 'holoviews', 'pandas'] +examples = ['panel', 'param', 'holoviews', 'pandas', 'jupyterlab', 'nodejs'] +tests = ['pytest', 'flake8'] + +[project.scripts] +uit = "uit.cli:cli" + +[project.urls] +source = "https://github.com/erdc/pyuit" + +[tool.setuptools.packages.find] +include = ["uit*"] + +[tool.setuptools.package-data] +uit = ["*.csv"] + +[tool.black] +line-length = 120 diff --git a/setup.py b/setup.py deleted file mode 100644 index 5ead74a..0000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -from setuptools import setup - -install_requires = [ - 'aiohttp', 'flask', 'PyYAML', 'requests', 'dodcerts', -] - -extras_require = dict() - -extras_require['guitools'] = ['panel', 'param', 'holoviews', 'pandas'] - -extras_require['examples'] = ['jupyterlab', 'nodejs'] + extras_require['guitools'] - -extras_require['tests'] = ['pytest', 'flake8'] - -setup( - name='pyuit', - version='0.7.0', - description="Python wrapper for DoD HPCMP UIT+ REST interface", - author="Scott Christensen", - author_email='scott.d.christensen@erdc.dren.mil', - url='https://github.com/erdc/uit', - packages=['uit', 'uit.gui_tools'], - include_package_data=True, - entry_points={ - 'console_scripts': [ - 'uit=uit.cli:cli' - ] - }, - install_requires=install_requires, - extras_require=extras_require, - python_requires=">=3.7", - keywords='uit', - classifiers=[ - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - ] -) diff --git a/tox.ini b/tox.ini index 8db4118..8d875b8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ [flake8] -ignore = E501 max-line-length = 120 exclude = .git,build,dist,__pycache__,.eggs,*.egg-info,venv +ignore = E203