Skip to content

Commit

Permalink
Add setup.py to resolve vanacli PATH issues (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
volod-vana authored Nov 11, 2024
1 parent 1cb8fb6 commit 92745d4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
13 changes: 12 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ web3 = "^6.18.0"
shtab = "^1.7.1"
pynacl = "^1.5.0"
eth-abi = "^5.1.0"
tomli = "^2.1.0"


[build-system]
requires = ["poetry-core"]
requires = ["poetry-core", "setuptools>=42", "wheel"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
vanacli = "vana.cli:main"

[tool.poetry.entry_points.console_scripts]
vanacli = "vana.cli:main"
27 changes: 27 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from setuptools import setup, find_packages
import tomli

with open("pyproject.toml", "rb") as f:
pyproject = tomli.load(f)

# Extract version and dependencies from pyproject.toml
version = pyproject["tool"]["poetry"]["version"]
dependencies = [
# Convert poetry dependency specs to pip format
f"{pkg}{ver.replace('^', '>=')}"
for pkg, ver in pyproject["tool"]["poetry"]["dependencies"].items()
if pkg != "python"
]

setup(
name="vana",
version=version,
packages=find_packages(),
install_requires=dependencies,
entry_points={
'console_scripts': [
'vanacli=vana.cli:main',
],
},
python_requires=pyproject["tool"]["poetry"]["dependencies"]["python"],
)

0 comments on commit 92745d4

Please sign in to comment.