From ce10916e54c4da12591dc72d52706cc9259fc924 Mon Sep 17 00:00:00 2001 From: Siva Mahadevan Date: Mon, 26 May 2025 12:16:35 -0400 Subject: [PATCH] migrate to pyproject.toml with hatch backend --- push_pypi.sh | 6 ++-- pyproject.toml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 47 ------------------------------ 3 files changed, 81 insertions(+), 50 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/push_pypi.sh b/push_pypi.sh index 4e84889..bd02d37 100755 --- a/push_pypi.sh +++ b/push_pypi.sh @@ -1,5 +1,5 @@ -#!/bin/bash -e +#!/bin/sh + rm -rf dist -python3 setup.py sdist bdist_wheel +hatch build twine upload dist/* - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7313935 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,78 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "klongpy" +version = "0.6.9" +description = "High-Performance Klong array language with rich Python integration." +readme = "README.md" +license = "MIT" +requires-python = "<3.13,>=3.9" +authors = [ + { name = "Brian Guarraci" }, +] +classifiers = [ + "Programming Language :: Python :: 3", +] +dependencies = [ + "numpy~=1.26.4", +] + +[project.optional-dependencies] +cuda102 = [ + "cupy-cuda102", +] +cuda110 = [ + "cupy-cuda110", +] +cuda111 = [ + "cupy-cuda111", +] +cuda11x = [ + "cupy-cuda11x", +] +cuda12x = [ + "cupy-cuda12x", +] +cupy = [ + "cupy", +] +db = [ + "duckdb==1.3.0", + "pandas==2.2.2", +] +full = [ + "aiohttp==3.9.4", + "colorama==0.4.6", + "duckdb==1.0.0", + "pandas==2.2.2", + "websockets==12.0", +] +repl = [ + "colorama==0.4.6", +] +rocm-4-3 = [ + "cupy-rocm-4-3", +] +rocm-5-0 = [ + "cupy-rocm-5-0", +] +web = [ + "aiohttp==3.9.4", +] +ws = [ + "websockets==12.0", +] + +[tool.hatch.build.targets.sdist] +include = [ + "/klongpy", +] + +[tool.hatch.envs.hatch-test] +extra-dependencies = [ + "aiohttp", + "duckdb", + "pandas", +] diff --git a/setup.py b/setup.py deleted file mode 100644 index b14fa8a..0000000 --- a/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -from setuptools import setup, find_packages - -directory = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(directory, 'README.md'), encoding='utf-8') as f: - long_description = f.read() - - -extra_requires = { - 'cupy': ["cupy"], - 'cuda12x': ["cupy-cuda12x"], - 'cuda11x': ["cupy-cuda11x"], - 'cuda111': ["cupy-cuda111"], - 'cuda110': ["cupy-cuda110"], - 'cuda102': ["cupy-cuda102"], - 'rocm-5-0': ["cupy-rocm-5-0"], - 'rocm-4-3': ["cupy-rocm-4-3"], - 'repl': ["colorama==0.4.6"], - 'web': ["aiohttp==3.9.4"], - 'db': ["pandas==2.2.2","duckdb==1.3.0"], - 'ws': ["websockets==12.0"], - } - -# full feature set extras -extra_requires['full'] = extra_requires['repl'] + extra_requires['web'] + extra_requires['db'] + extra_requires['ws'] - -setup( - name='klongpy', - packages=find_packages(), - version='0.6.9', - description='High-Performance Klong array language with rich Python integration.', - author='Brian Guarraci', - license='MIT', - long_description=long_description, - long_description_content_type='text/markdown', - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License" - ], - install_requires=['numpy~=1.26.4'], - python_requires='<3.13,>=3.9', - extras_require=extra_requires, - include_package_data=True, - zip_safe=False, - test_suite='tests', - scripts=['scripts/kgpy'] -)