-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
111 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,5 @@ dist | |
pyrobird/requirements-dev.lock | ||
|
||
pyrobird/requirements.lock | ||
|
||
pyrobird/src/pyrobird/server/static/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
// Flag indicates if python Flask server from Pyrobird package is in used. Set automatically by Pyrobird | ||
"servedByPyrobird": true | ||
"servedByPyrobird": false | ||
} |
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,51 @@ | ||
import os | ||
import shutil | ||
import subprocess | ||
import sys | ||
|
||
|
||
def main(): | ||
# Identify the script's path | ||
script_path = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
# Define the paths | ||
firebird_ng_path = os.path.join(script_path, '..', 'firebird-ng') | ||
dist_path = os.path.join(firebird_ng_path, 'dist', 'firebird') | ||
static_path = os.path.join(script_path, 'src', 'pyrobird', 'server', 'static') | ||
# Fancy print the paths | ||
print(f"Script Path: {script_path}") | ||
print(f"Firebird NG Path: {firebird_ng_path}") | ||
print(f"Dist Path: {dist_path}") | ||
print(f"Static Path: {static_path}") | ||
|
||
# Run `ng build` in script_path/../firebird-ng directory | ||
try: | ||
print("Running ng build at firebird-ng") | ||
subprocess.run(['ng', 'build'], cwd=firebird_ng_path, check=True) | ||
except subprocess.CalledProcessError as e: | ||
print(f"Error running 'ng build': {e}") | ||
sys.exit(1) | ||
|
||
# Remove all files and folders in script_path/src/pyrobird/server/static | ||
print("removing existing src/pyrobird/server/static") | ||
if os.path.exists(static_path): | ||
shutil.rmtree(static_path) | ||
os.makedirs(static_path) | ||
|
||
# Copy all files and directories from script_path/../firebird-ng/dist/firebird to script_path/src/pyrobird/server/static | ||
print("copying firebird-ng/dist/firebird to src/pyrobird/server/static") | ||
if os.path.exists(dist_path): | ||
for item in os.listdir(dist_path): | ||
s = os.path.join(dist_path, item) | ||
d = os.path.join(static_path, item) | ||
if os.path.isdir(s): | ||
shutil.copytree(s, d) | ||
else: | ||
shutil.copy2(s, d) | ||
else: | ||
print(f"Source directory {dist_path} does not exist.") | ||
sys.exit(1) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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,6 +13,7 @@ keywords = [] | |
authors = [ | ||
{ name = "Dmitry Romanov", email = "[email protected]" }, | ||
] | ||
packages = [{ include = "pyrobird" }] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python", | ||
|
@@ -25,7 +26,7 @@ classifiers = [ | |
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = [ | ||
"click", "rich", "pyyaml", "flask_cors" | ||
"click", "rich", "pyyaml", "flask_cors", "json5" | ||
] | ||
|
||
#[project.urls] | ||
|
@@ -34,7 +35,8 @@ dependencies = [ | |
#Source = "https://github.com/eic/firebird" | ||
|
||
[project.scripts] | ||
fbd = "pyrobird.cli:pyrobird" | ||
fbd = "pyrobird.cli:cli_app" | ||
pyrobird = "pyrobird.cli:cli_app" | ||
|
||
[tool.hatch.version] | ||
path = "src/pyrobird/__about__.py" | ||
|
@@ -79,6 +81,11 @@ exclude_lines = [ | |
"if TYPE_CHECKING:", | ||
] | ||
|
||
[tool.hatch.build] | ||
packages = [ | ||
"src/pyrobird" | ||
] | ||
|
||
[tool.hatch.publish.index] | ||
disable = true | ||
repository = "https://upload.pypi.org/legacy/" | ||
|
@@ -93,3 +100,4 @@ include = [ | |
"src/pyrobird/server/static/**/*", | ||
"src/pyrobird/server/templates/**/*" | ||
] | ||
|
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
This file was deleted.
Oops, something went wrong.