From 1b72f71a32716402609dcb3050e158a2579736f9 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 1 Mar 2024 17:00:46 +0100 Subject: [PATCH] Switch to pyproject.toml; bump to 0.16.0 for latest Preserves and protocols --- .envrc | 12 ++++++++---- Makefile | 15 +++++++++------ pyproject.toml | 44 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 26 -------------------------- 4 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.envrc b/.envrc index e630220..601f6f7 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,8 @@ -[ -d .venv ] || python -m venv .venv -. .venv/bin/activate -pip install -U setuptools setuptools_scm wheel -pip install -r requirements.txt +if ! [ -d .venv ] +then + python -m venv .venv + . .venv/bin/activate + pip install -e '.[dev]' +else + . .venv/bin/activate +fi diff --git a/Makefile b/Makefile index 4989a2a..f848d57 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +PACKAGEVERSION := $(shell python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])') + all: clean: @@ -7,17 +9,18 @@ clean: rm -rf *.egg-info build dist tag: - git tag v`python3 setup.py --version` + git tag v$(PACKAGEVERSION) -# sudo apt install python3-wheel twine -publish: build +publish: clean build twine upload dist/* -build: clean - python3 setup.py sdist bdist_wheel +build: dist/syndicate-py-$(PACKAGEVERSION).tar.gz + +dist/syndicate-py-$(PACKAGEVERSION).tar.gz: + python3 -m build veryclean: clean - rm -rf pyenv + rm -rf .venv PROTOCOLS_BRANCH=main pull-protocols: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8127c35 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "syndicate-py" +version = "0.16.0" +description = "Syndicated Actor model and Syndicate network protocol for Python 3" +readme = "README.md" +requires-python = ">=3.6, <4" +license = {text = "GPL-3.0-or-later"} + +authors = [ + {name = "Tony Garnock-Jones", email = "tonyg@leastfixedpoint.com"}, +] + +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries :: Python Modules", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Programming Language :: Python :: 3", +] + +dependencies = [ + "websockets", + "preserves", +] + +[project.urls] +Homepage = "https://git.syndicate-lang.org/syndicate-lang/syndicate-py" +Issues = "https://git.syndicate-lang.org/syndicate-lang/syndicate-py/issues" + +[project.optional-dependencies] +dev = [ + "build", + "twine", +] + +[tool.setuptools] +packages = ["syndicate"] + +[tool.setuptools.package-data] +syndicate_py = ["*"] + +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py deleted file mode 100644 index bcf9021..0000000 --- a/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -setup( - name="syndicate-py", - version="0.15.0", - author="Tony Garnock-Jones", - author_email="tonyg@leastfixedpoint.com", - license="GNU General Public License v3 or later (GPLv3+)", - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries :: Python Modules", - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Programming Language :: Python :: 3", - ], - packages=["syndicate"], - url="https://git.syndicate-lang.org/syndicate-lang/syndicate-py", - description="Syndicated Actor model and Syndicate network protocol for Python 3", - install_requires=['websockets', 'preserves'], - python_requires=">=3.6, <4", - setup_requires=['setuptools_scm'], - include_package_data=True, -)