-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Distributive-Network/feature/poetry
Feature/poetry: Add poetry build and publish process whenever a release is tagged
- Loading branch information
Showing
7 changed files
with
246 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ tests/__pycache__/* | |
tests/python/__pycache__/* | ||
Testing/Temporary | ||
_spidermonkey_install | ||
__pycache__ | ||
dist | ||
*.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import subprocess | ||
import os, sys | ||
|
||
dir_path = os.path.dirname( os.path.realpath(__file__) ) | ||
|
||
|
||
def execute(cmd: str): | ||
popen = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, | ||
shell = True, text = True ) | ||
for stdout_line in iter(popen.stdout.readline, ""): | ||
sys.stdout.write(stdout_line) | ||
sys.stdout.flush() | ||
|
||
popen.stdout.close() | ||
return_code = popen.wait() | ||
if return_code: | ||
raise subprocess.CalledProcessError(return_code, cmd) | ||
|
||
def build(): | ||
build_script_sh = os.path.join( dir_path, 'build_script.sh' ) | ||
execute(f"bash {build_script_sh}") | ||
execute(f"cp ./build/src/pythonmonkey.so ./python/pythonmonkey/pythonmonkey.so") | ||
|
||
if __name__ == "__main__": | ||
build() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[tool.poetry] | ||
name = "pythonmonkey" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Caleb Aikens <caleb@distributive.network>", "Tom Tang <xmader@distributive.network>"] | ||
readme = "README.md" | ||
packages = [ | ||
{ include = "pythonmonkey", from = "python" }, | ||
] | ||
include = [ "python/pythonmonkey/pythonmonkey.so" ] | ||
|
||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
|
||
|
||
[tool.poetry.build] | ||
script = "build.py" | ||
generate-setup-file = false | ||
|
||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^7.3.1" | ||
pip = "^23.1.2" | ||
numpy = "^1.24.3" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0a9"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .pythonmonkey import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters