From 562620415ebead25f1668ba5c1f77d4972c7563c Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Tue, 29 Jul 2025 15:47:41 +1000 Subject: [PATCH 1/6] pyproject.toml Signed-off-by: Max Chesterfield --- pyproject.toml | 58 +++++++++++++++++++ setup.py | 7 +-- .../translator/test_network_translator.py | 4 ++ tox.ini | 24 ++++---- 4 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..f9de1b939 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +# Copyright 2025 Zeppelin Bend Pty Ltd +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +[build-system] + requires = [ + "setuptools", + "wheel", + "build>=1.2.0" + ] + build-backend = "setuptools.build_meta" + +[project] + name = "zepben.evolve" + version = "0.48.0b6" + description = "Python SDK for interacting with the Evolve platform" + readme = {file = "README.md", content-type = "test/markdown"} + license = "MPL-2.0" + requires-python = '>=3.9,<3.13' + authors = [ + {name = "Kurt Greaves", email = "kurt.greaves@zepben.com"}, + {name = "Max Chesterfield", email = "max.chesterfield@zepben.com"} + ] + dependencies = [ + "zepben.auth==0.12.1", + "zepben.protobuf==0.37.0", + "typing_extensions==4.12.2" + ] + classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent" + ] + +[project.urls] + Repository = "https://github.com/zepben/evolve-sdk-python" + Homepage = "https://zepben.com" + +[project.optional-dependencies] + test = [ + "pytest>=7.2.0", + "pytest-cov==6.1.1", + "pytest-asyncio==0.26.0", + "pytest-timeout==2.4.0", + "pytest-subtests", + "hypothesis==6.119.4", # 6.120.0 has issues with one of our large tests + "grpcio-testing==1.61.3", + "pylint==2.14.5", + "six==1.16.0", + "tox" + ] + +[tool.setuptools.packages.find] + where = ["src/"] diff --git a/setup.py b/setup.py index 2c181076f..f7e6852e6 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,10 @@ -# Copyright 2024 Zeppelin Bend Pty Ltd +# Copyright 2025 Zeppelin Bend Pty Ltd # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. -from setuptools import setup, find_namespace_packages +import setuptools -with open("README.md", "r") as fh: - long_description = fh.read() +setuptools.setup() deps = [ "zepben-protobuf==1.0.0b1", diff --git a/test/services/network/translator/test_network_translator.py b/test/services/network/translator/test_network_translator.py index acb35913f..70db5bab2 100644 --- a/test/services/network/translator/test_network_translator.py +++ b/test/services/network/translator/test_network_translator.py @@ -235,6 +235,10 @@ def test_network_service_translations(**kwargs): # If this test still appears to lock up, it is likely you have missed validating a class or forgot to exclude the table. Either figure out which # case you have, or wait for the test to finish, and it will tell you. # + # NOTE: updating hypothesis can break this test on python 3.9 to 1.200.0 and beyond, if you do that, and it breaks, this command + # will run only this test: + # tox -e py39 -- test/services/network/translator/test_network_translator.py::test_network_service_translations --no-cov + # validate_service_translations( NetworkService, NetworkServiceComparator(), diff --git a/tox.ini b/tox.ini index ce3fd73d4..5491ab1be 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,22 @@ [tox] -envlist = py311 - py310 - py39 +envlist = + py{312, 311, 310, 39} + build [testenv] -allowlist_externals = /bin/bash - /usr/bin/bash +# run our tests, and setup the dependecy tree passenv = GITHUB_* pip_pre = true -deps = - .[test] -commands = - pytest --cov=zepben.ewb --cov-report=xml --cov-branch {posargs} - python setup.py bdist_wheel +extras = test +depends = + # build the package after testing + build: py{312, 311, 310, 39} +commands = pytest --cov=zepben.evolve --cov-report=xml --cov-branch {posargs} +[testenv:build] +# build the wheel +commands = python -m pip install build + python -m build [pytest] pythonpath = ./src ./test @@ -22,4 +25,5 @@ log_file = pytest.log log_file_date_format = %Y-%m-%d %H:%M:%S log_file_format = %(asctime)s %(levelname)s %(message)s asyncio_mode = auto +asyncio_default_fixture_loop_scope = function timeout = 15 From ae85df0eacce463bfc0370965bf3e9678d6e3d3f Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Tue, 29 Jul 2025 16:20:55 +1000 Subject: [PATCH 2/6] tweaks Signed-off-by: Max Chesterfield --- pyproject.toml | 11 +++++++---- tox.ini | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f9de1b939..376b03192 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,9 +23,12 @@ {name = "Max Chesterfield", email = "max.chesterfield@zepben.com"} ] dependencies = [ - "zepben.auth==0.12.1", - "zepben.protobuf==0.37.0", - "typing_extensions==4.12.2" + "zepben.protobuf==1.0.0b1", + "typing_extensions==4.12.2", + "requests>=2.26.0, <3.0.0", + "urllib3>=1.26.6, <1.27.0", + "PyJWT>=2.1.0, <2.2.0", + "dataclassy==0.6.2", ] classifiers = [ "Programming Language :: Python :: 3", @@ -42,7 +45,7 @@ [project.optional-dependencies] test = [ - "pytest>=7.2.0", + "pytest>=7.4.4, <9", "pytest-cov==6.1.1", "pytest-asyncio==0.26.0", "pytest-timeout==2.4.0", diff --git a/tox.ini b/tox.ini index 5491ab1be..dc276a095 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ extras = test depends = # build the package after testing build: py{312, 311, 310, 39} -commands = pytest --cov=zepben.evolve --cov-report=xml --cov-branch {posargs} +commands = pytest --cov=zepben.ewb --cov-report=xml --cov-branch {posargs} [testenv:build] # build the wheel From 32483f393d3f99cd482c377123a973941c08e3f7 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Thu, 31 Jul 2025 15:14:08 +1000 Subject: [PATCH 3/6] verison and package name Signed-off-by: Max Chesterfield --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 376b03192..c148c4fa3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,8 +12,8 @@ build-backend = "setuptools.build_meta" [project] - name = "zepben.evolve" - version = "0.48.0b6" + name = "zepben.ewb" + version = "1.0.0b2" description = "Python SDK for interacting with the Evolve platform" readme = {file = "README.md", content-type = "test/markdown"} license = "MPL-2.0" From f990f9aaf1f34f338dfe6e95d7c6a09fe16be85b Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Wed, 20 Aug 2025 15:05:54 +1000 Subject: [PATCH 4/6] fix merge Signed-off-by: Max Chesterfield --- pyproject.toml | 4 ++-- setup.py | 49 ------------------------------------------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c148c4fa3..879457cb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,8 +13,8 @@ [project] name = "zepben.ewb" - version = "1.0.0b2" - description = "Python SDK for interacting with the Evolve platform" + version = "1.0.0b6" + description = "Python SDK for interacting with the Energy Workbench platform" readme = {file = "README.md", content-type = "test/markdown"} license = "MPL-2.0" requires-python = '>=3.9,<3.13' diff --git a/setup.py b/setup.py index f7e6852e6..6d4969e92 100644 --- a/setup.py +++ b/setup.py @@ -5,52 +5,3 @@ import setuptools setuptools.setup() - -deps = [ - "zepben-protobuf==1.0.0b1", - "typing_extensions==4.12.2", - "requests>=2.26.0, <3.0.0", - "urllib3>=1.26.6, <1.27.0", - "PyJWT>=2.1.0, <2.2.0", - "dataclassy==0.6.2", -] - -test_deps = [ - "pytest==7.1.2", - "pytest-cov==2.10.1", - "pytest-asyncio==0.19.0", - "pytest-timeout==1.4.2", - 'pytest-subtests', - "hypothesis==6.56.3", - "grpcio-testing==1.61.3", - "pylint==2.14.5", - "six==1.16.0", - "tox" -] - -setup( - name="zepben.ewb", - version="1.0.0b6", - description="Python SDK for interacting with the Energy Workbench platform", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/zepben/evolve-sdk-python", - author="Kurt Greaves", - author_email="kurt.greaves@zepben.com", - license="MPL 2.0", - classifiers=[ - "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Operating System :: OS Independent" - ], - package_dir={"": "src"}, - packages=find_namespace_packages(where="src"), - python_requires='>=3.9,<3.13', - install_requires=deps, - extras_require={ - "test": test_deps, - } -) From 19a3e844bcf304e6ae924ea3e478346e72da0ec0 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Thu, 21 Aug 2025 00:43:39 +1000 Subject: [PATCH 5/6] did dun the thing Signed-off-by: Max Chesterfield --- .github/workflows/python-lib-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-lib-build.yml b/.github/workflows/python-lib-build.yml index 87e81c367..ce7e49329 100644 --- a/.github/workflows/python-lib-build.yml +++ b/.github/workflows/python-lib-build.yml @@ -6,7 +6,7 @@ on: jobs: run: - uses: zepben/.github/.github/workflows/python-build.yml@main + uses: zepben/.github/.github/workflows/python-build.yml@python3.10 with: private: false secrets: inherit From de44a8807e37a441fa8675173fb6d8a3411a5154 Mon Sep 17 00:00:00 2001 From: Max Chesterfield Date: Thu, 21 Aug 2025 00:57:22 +1000 Subject: [PATCH 6/6] test seems ok, try main now Signed-off-by: Max Chesterfield --- .github/workflows/python-lib-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-lib-build.yml b/.github/workflows/python-lib-build.yml index ce7e49329..87e81c367 100644 --- a/.github/workflows/python-lib-build.yml +++ b/.github/workflows/python-lib-build.yml @@ -6,7 +6,7 @@ on: jobs: run: - uses: zepben/.github/.github/workflows/python-build.yml@python3.10 + uses: zepben/.github/.github/workflows/python-build.yml@main with: private: false secrets: inherit