Skip to content

Commit

Permalink
refactor: migrate ape-config.yaml to pyproject.toml (#117)
Browse files Browse the repository at this point in the history
Co-authored-by: antazoey <[email protected]>
  • Loading branch information
antazoey and antazoey authored Jan 9, 2025
1 parent 0647ffe commit 22decc1
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 74 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sdk/py/apepay/version.py
__pycache__
.hypothesis
dist/
*.egg-info

# Javascript
node_modules/
Expand Down
42 changes: 0 additions & 42 deletions ape-config.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions bots/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def load_db(_):
@sm.on_stream_created(app)
async def grant_product(stream):
db[stream.id] = stream
print(f"provisioning products: {stream.products}")
print(f"provisioning products: {stream.products}") # noqa: T001
return stream.time_left


Expand All @@ -37,6 +37,6 @@ async def update_product_funding(stream):

@sm.on_stream_cancelled(app)
async def revoke_product(stream):
print(f"unprovisioning product for {stream.creator}")
print(f"unprovisioning product for {stream.creator}") # noqa: T001
db[stream.id] = None
return stream.time_left
104 changes: 75 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,102 @@
[build-system]
requires = [ "setuptools>=64", "setuptools_scm>=8" ]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "apepay"
dynamic = [ "version" ]
dynamic = ["version"]
description = "Python SDK for ApePay"
authors = [
{name = "ApeWorX LTD", email = "[email protected]"},
]
authors = [{ name = "ApeWorX LTD", email = "[email protected]" }]
license = { text = "Apache 2.0" }
readme = "README.md"
requires-python = ">=3.10,<4"

dependencies = [
"eth-ape>=0.8,<1",
"pydantic>=2.7,<3",
# NOTE: Pinning issue w/ Ape
"eth-typing<5",
]
dependencies = ["eth-ape>=0.8.24,<1", "pydantic>=2.7,<3"]

[project.optional-dependencies]
bot = [
"silverback>=0.5,<1",
]
bot = ["silverback>=0.5,<1"]
lint = [
"flake8",
"black",
"isort",
"mypy",
# NOTE: Be able to lint our silverback add-ons
"apepay[bot]"
]
test = [
"ape-foundry",
]
dev = [
"apepay[bot,lint,test]"
"flake8",
"black",
"isort",
"mypy",
# NOTE: Be able to lint our silverback add-ons
"apepay[bot]",
]
test = ["ape-foundry"]
dev = ["apepay[bot,lint,test]"]

[tool.setuptools.packages.find]
where = [ "sdk/py" ]
where = ["sdk/py"]

[tool.setuptools.package-data]
apepay = [ "manifest.json", "py.typed" ]
apepay = ["manifest.json", "py.typed"]

[tool.setuptools_scm]
# NOTE: Config entry needed for this plugin to function

[tool.ape]
name = "ApePay"

plugins = [
{ name = "arbitrum" },
{ name = "optimism" },
{ name = "foundry" },
{ name = "vyper" },
]

[tool.ape.compile]
output_extra = ["ABI"]

[tool.ape.ethereum.local]
default_provider = "foundry"

[tool.ape.deployments.ethereum]
[[tool.ape.deployments.ethereum.sepolia]]
contract_type = "StreamFactory"
address = "0x92823EB2DB42b8df354EDB5A1FB3668057e2935D"
salt = "ApePay v0.3"

[[tool.ape.deployments.ethereum.sepolia]]
contract_type = "StreamManager"
address = "0x6A1aa538ebB85Fd98655eCEe5EaB7D9cb3cbCD2B"
salt = "ApePay v0.3"
blueprint = true

[[tool.ape.deployments.arbitrum.mainnet]]
contract_type = "StreamFactory"
address = "0x92823EB2DB42b8df354EDB5A1FB3668057e2935D"
salt = "ApePay v0.3"

[[tool.ape.deployments.arbitrum.mainnet]]
contract_type = "StreamManager"
address = "0x6A1aa538ebB85Fd98655eCEe5EaB7D9cb3cbCD2B"
salt = "ApePay v0.3"
blueprint = true

[[tool.ape.deployments.optimism.mainnet]]
contract_type = "StreamFactory"
address = "0x92823EB2DB42b8df354EDB5A1FB3668057e2935D"
salt = "ApePay v0.3"

[[tool.ape.deployments.optimism.mainnet]]
contract_type = "StreamManager"
address = "0x6A1aa538ebB85Fd98655eCEe5EaB7D9cb3cbCD2B"
salt = "ApePay v0.3"
blueprint = true

[[tool.ape.test.gas.exclude]]
contract_name = "Test*"

[[tool.ape.test.coverage.exclude]]
contract_name = "Test*"

[tool.ape.test.coverage.reports.terminal]
verbose = true

[tool.black]
line-length = 100
target-version = [ "py311" ]
target-version = ["py311"]
include = '\.pyi?$'
exclude = 'node_modules|migrations|build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.tox/|\.venv/'

Expand Down
2 changes: 1 addition & 1 deletion sdk/py/apepay/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self):

class NotEnoughAllowance(ApePayException, ValueError):
def __init__(self, manager: AddressType):
super().__init__(f"Not enough allownace, please approve {manager}")
super().__init__(f"Not enough allowance, please approve {manager}")


class StreamLifeInsufficient(ApePayException, ValueError):
Expand Down

0 comments on commit 22decc1

Please sign in to comment.