Skip to content

Commit

Permalink
👷 Implement snekmate Namespaced Distribution Package (#204)
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
  • Loading branch information
pcaversaccio authored Feb 9, 2024
1 parent 887ab26 commit 6533acd
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
--user
- name: Build a binary wheel and a source tarball
run: python -m build
run: python scripts/build.py

- name: Store the distribution packages
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
--user
- name: Build a binary wheel and a source tarball
run: python -m build
run: python scripts/build.py

- name: Store the distribution packages
uses: actions/upload-artifact@v4
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
- [`Math`](https://github.com/pcaversaccio/snekmate/blob/v0.0.5/src/utils/Math.vy): Rename the recently added `sign` function to `signum` to avoid any ambiguity with cryptographic signing utility functions. ([#188](https://github.com/pcaversaccio/snekmate/pull/188))
- [`Math`](https://github.com/pcaversaccio/snekmate/blob/v0.0.5/src/utils/Math.vy): Optimise the zero point threshold in `wad_exp`. ([#189](https://github.com/pcaversaccio/snekmate/pull/189))

### 🔖 Release Management

- Implement `snekmate`-namespaced distribution package building for TestPyPI and PyPI. ([#204](https://github.com/pcaversaccio/snekmate/pull/204))

### 👀 Full Changelog

- [`v0.0.4...v0.0.5`](https://github.com/pcaversaccio/snekmate/compare/v0.0.4...v0.0.5)
Expand Down
2 changes: 1 addition & 1 deletion lib/forge-std
Submodule forge-std updated 2 files
+3 −0 src/Vm.sol
+1 −1 test/Vm.t.sol
2 changes: 1 addition & 1 deletion lib/solady
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snekmate",
"version": "0.0.5-rc.1",
"version": "0.0.5-rc.2",
"description": "State-of-the-art, highly opinionated, hyper-optimised, and secure 🐍Vyper smart contract building blocks.",
"author": "Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>",
"license": "AGPL-3.0-only",
Expand Down Expand Up @@ -39,7 +39,7 @@
"@openzeppelin/merkle-tree": "^1.0.6",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"ethers": "^6.10.0",
"ethers": "^6.11.0",
"keccak256": "^1.0.6",
"merkletreejs": "^0.3.11",
"prettier": "^3.2.5",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "snekmate"
version = "0.0.5rc1"
version = "0.0.5rc2"
description = "State-of-the-art, highly opinionated, hyper-optimised, and secure 🐍Vyper smart contract building blocks."
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.10"
Expand Down
28 changes: 28 additions & 0 deletions scripts/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os, subprocess, shutil

base_path = os.path.join(os.getcwd(), "src")
dir_list = ["auth", "extensions", "governance", "tokens", "utils"]
dest_build = os.path.join(base_path, "snekmate")

# Create a dedicated `snekmate` directory.
os.mkdir(dest_build)

# Before generating the distribution package, move all
# contracts to a dedicated `snekmate` directory.
for dir in dir_list:
source = os.path.join(base_path, dir)
if os.path.isdir(source):
shutil.move(source, dest_build)

# Build a binary wheel and a source tarball.
subprocess.run(["python3", "-m", "build"])

# After generating the distribution package, move all
# contracts back to the original destination.
for dir in dir_list:
source = os.path.join(base_path, "snekmate", dir)
if os.path.isdir(source):
shutil.move(source, base_path)

# Delete the dedicated `snekmate` directory.
shutil.rmtree(dest_build)

0 comments on commit 6533acd

Please sign in to comment.