-
Couldn't load subscription status.
- Fork 8
CTX-5485: Changes regarding decision to not use anymore coretex cli tool which was installed via pip. #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
7378b02
2fc25d6
32c4bb5
87800f3
a827aea
e6986d5
dd85839
2040903
3d1e1f6
4cbaa52
3426b3b
03a8d76
da82d1c
9013f1f
7056dc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Create a Python virtual environment | ||
| python -m venv compile_env | ||
|
|
||
| # Activate the virtual environment | ||
| source compile_env/bin/activate | ||
|
|
||
| # Install the current package and pyinstaller | ||
| pip install .. pyinstaller | ||
|
|
||
| # Run PyInstaller with the specified options | ||
| pyinstaller ../main.py --onedir --name coretex --copy-metadata readchar --copy-metadata coretex --add-data "../coretex/resources/_coretex.py:coretex/resources" --workpath coretex --noconfirm | ||
|
|
||
| # Deactivate and remove the virtual environment | ||
| deactivate | ||
| rm -rf compile_env | ||
| rm -rf coretex.spec |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Define package name and directory structure | ||
| PACKAGE_NAME="coretex" | ||
| PACKAGE_DIR="${PACKAGE_NAME}" | ||
| DEBIAN_DIR="${PACKAGE_DIR}/DEBIAN" | ||
| BIN_DIR="${PACKAGE_DIR}/usr/local/bin" | ||
|
|
||
| # Create the necessary directory structure | ||
| mkdir -p "${DEBIAN_DIR}" | ||
| mkdir -p "${BIN_DIR}" | ||
|
|
||
| # Create a Python virtual environment | ||
| python -m venv compile_env | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename the venv to |
||
|
|
||
| # Activate the virtual environment | ||
| source compile_env/bin/activate | ||
|
|
||
| # Install the toml package (for generate_control.py) | ||
| pip install toml | ||
|
|
||
| # Move the entire dist/main directory contents directly to /usr/local/bin | ||
| mv dist/coretex/* "${BIN_DIR}/" | ||
| rm -rf dist/ | ||
|
|
||
| # Generate the control file using Python (assuming you have the Python script ready) | ||
| python generate_control.py | ||
|
|
||
| # Deactivate and remove the virtual environment | ||
| deactivate | ||
| rm -rf compile_env | ||
|
|
||
| # Build the .deb package | ||
| dpkg-deb --build "${PACKAGE_DIR}" | ||
|
|
||
| # Remove unnecessary dir's | ||
| rm -rf "${PACKAGE_DIR}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import toml | ||
|
|
||
|
|
||
| def main() -> None: | ||
| # Load data from pyproject.toml | ||
| with open("../pyproject.toml", "r") as f: | ||
| pyproject = toml.load(f) | ||
|
|
||
| # Extract necessary information | ||
| packageName = pyproject["project"]["name"] | ||
| version = pyproject["project"]["version"] | ||
| description = pyproject["project"]["description"] | ||
|
|
||
| # Create control file content | ||
| controlContent = ( | ||
| f"Package: {packageName}\n" | ||
| f"Version: {version}\n" | ||
| "Section: base\n" | ||
| "Priority: optional\n" | ||
| "Architecture: all\n" | ||
| "Depends: python3\n" | ||
| "Maintainer: Your Name < your.email@example.com >\n" | ||
| f"Description: {description}\n" | ||
| ) | ||
|
|
||
| # Write to control file | ||
| with open(f"{packageName}/DEBIAN/control", "w") as controlFile: | ||
| controlFile.write(controlContent) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Extract version from pyproject.toml | ||
| VERSION=$(grep '^version = ' ../pyproject.toml | sed 's/version = "\(.*\)"/\1/') | ||
|
|
||
| # Define package name and directory structure | ||
| PACKAGE_NAME="coretex" | ||
| PAYLOAD_DIR="dist/coretex/" | ||
|
|
||
| # Build the .pkg package using pkgbuild | ||
| pkgbuild --root "${PAYLOAD_DIR}" --identifier ai.coretex --version "${VERSION}" --install-location "/usr/local/bin" "${PACKAGE_NAME}.pkg" | ||
|
|
||
| # Clean up | ||
| rm -rf coretex/ | ||
| rm -rf dist/ |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "dist/SOMETHING_SOMETHING"