Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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.ewb"
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'
authors = [
{name = "Kurt Greaves", email = "kurt.greaves@zepben.com"},
{name = "Max Chesterfield", email = "max.chesterfield@zepben.com"}
]
dependencies = [
"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",
"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.4.4, <9",
"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/"]
56 changes: 3 additions & 53 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,7 @@
# 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()

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,
}
)
setuptools.setup()
4 changes: 4 additions & 0 deletions test/services/network/translator/test_network_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
24 changes: 14 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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.ewb --cov-report=xml --cov-branch {posargs}

[testenv:build]
# build the wheel
commands = python -m pip install build
python -m build

[pytest]
pythonpath = ./src ./test
Expand All @@ -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