-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 Implement
snekmate
Namespaced Distribution Package (#204)
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
- Loading branch information
1 parent
887ab26
commit 6533acd
Showing
10 changed files
with
47 additions
and
15 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
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
Submodule openzeppelin-contracts
updated
25 files
Submodule solady
updated
5 files
+65 −55 | .gas-snapshot | |
+1 −1 | package.json | |
+276 −3 | src/utils/LibClone.sol | |
+127 −152 | src/utils/RedBlackTreeLib.sol | |
+131 −0 | test/LibClone.t.sol |
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
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
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,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) |