-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(util): move functions out of util
make project installable on Jython add devcontainer add Jython install tests BREAKING CHANGE: deprecate incendium.util functions
- Loading branch information
1 parent
ca1658a
commit 23e0aa9
Showing
31 changed files
with
1,144 additions
and
254 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "incendium", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance" | ||
], | ||
"settings": { | ||
"python.defaultInterpreterPath": "/opt/python/2/bin/python" | ||
} | ||
} | ||
}, | ||
"onCreateCommand": "pre-commit install && pre-commit install --hook-type commit-msg" | ||
} |
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 @@ | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
pylint: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
JYTHON_VERSION: '2.7.3' | ||
JYTHON_CACHE_DIR: '~/.cache/jython' | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Jython | ||
uses: coatl-dev/actions/setup-jython@v3 | ||
id: setup-jython | ||
with: | ||
jython-version: ${{ env.JYTHON_VERSION }} | ||
|
||
- name: Cache Jython | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.JYTHON_CACHE_DIR }} | ||
key: jy-${{ steps.setup-jython.outputs.jython-path }}-${{ runner.os }}-${{ hashFiles('setup.py') }} | ||
|
||
- name: Test installation on Jython | ||
run: | | ||
make install JYTHON_CACHE_DIR=${{ env.JYTHON_CACHE_DIR }} |
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 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,3 @@ | ||
César Román <[email protected]> César Román <[email protected]> | ||
César Román <[email protected]> César Román <[email protected]> | ||
César Román <[email protected]> Cesar Roman <[email protected]> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# hadolint global ignore=DL3008,DL3042 | ||
FROM coatldev/six:3.12 as base | ||
|
||
ENV JYTHON_VERSION 2.7.3 | ||
ENV JYTHON_HOME /opt/jython/${JYTHON_VERSION} | ||
|
||
RUN set -eux; \ | ||
\ | ||
apt-get update --quiet; \ | ||
apt-get install --yes --no-install-recommends \ | ||
openjdk-17-jre \ | ||
; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# >============================================================================< | ||
|
||
FROM base as jython | ||
|
||
RUN set -eux; \ | ||
\ | ||
apt-get update --quiet; \ | ||
apt-get install --yes --no-install-recommends \ | ||
wget \ | ||
; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /tmp | ||
|
||
RUN set -eux; \ | ||
\ | ||
wget -q "https://repo1.maven.org/maven2/org/python/jython-installer/${JYTHON_VERSION}/jython-installer-${JYTHON_VERSION}.jar"; \ | ||
\ | ||
java -jar "jython-installer-${JYTHON_VERSION}.jar" \ | ||
--silent \ | ||
--type standard \ | ||
--directory "$JYTHON_HOME" | ||
|
||
# >============================================================================< | ||
|
||
FROM base as final | ||
|
||
COPY --from=jython ${JYTHON_HOME}/ ${JYTHON_HOME}/ | ||
|
||
ENV PATH ${JYTHON_HOME}/bin:$PATH | ||
|
||
COPY requirements /tmp/requirements/ | ||
|
||
RUN set -eux; \ | ||
\ | ||
python2 -m pip install --requirement \ | ||
/tmp/requirements/dev.txt; \ | ||
\ | ||
python3 -m pip install --requirement \ | ||
/tmp/requirements/build.txt | ||
|
||
CMD ["/bin/bash"] |
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,60 @@ | ||
JYTHON_CACHE_DIR := ~/.cache/jython | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
##@ Help | ||
|
||
.PHONY: help clean check init install install-clean install-force install-nocache install-nodeps | ||
|
||
help: ## Display this help message. | ||
@awk \ | ||
'BEGIN { \ | ||
FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n" \ | ||
} \ | ||
/^[a-zA-Z_-]+:.*?##/ { \ | ||
printf " \033[36m%-16s\033[0m %s\n", $$1, $$2 \ | ||
} \ | ||
/^##@/ { \ | ||
printf "\n\033[1m%s\033[0m\n", substr($$0, 5) \ | ||
} ' \ | ||
$(MAKEFILE_LIST) | ||
|
||
##@ Cleanup | ||
|
||
clean: ## Uninstall all Jython packages. | ||
@ echo "Uninstalling all Jython packages…" | ||
jython -m pip freeze | xargs jython -m pip uninstall -y | ||
|
||
##@ Initialize | ||
|
||
check: ## Check if Jython is installed. | ||
@echo "Cheking if Jython is installed…" | ||
@if ! command -v jython &> /dev/null; then \ | ||
echo "Jython is not installed. Please install Jython before proceeding."; \ | ||
exit 1; \ | ||
fi | ||
|
||
init: ## Run check and create required directories for other targets. | ||
@echo "Initializing…" | ||
@mkdir -p "$(JYTHON_CACHE_DIR)" | ||
|
||
##@ Install | ||
install: check init ## Install this package using Jython with caching enabled. | ||
@echo "Installing package…" | ||
jython -m pip install --cache-dir="$(JYTHON_CACHE_DIR)" . | ||
|
||
install-clean: check init clean ## Perform clean installation using Jython with caching enabled. | ||
@echo "Running clean install…" | ||
jython -m pip install --cache-dir="$(JYTHON_CACHE_DIR)" . | ||
|
||
install-force: check init ## Reinstall all packages using Jython even if they are already up-to-date. | ||
@echo "Reinstalling all packages…" | ||
jython -m pip install --force-reinstall --cache-dir="$(JYTHON_CACHE_DIR)" . | ||
|
||
install-nocache: check ## Install this package using Jython with caching disabled. | ||
@echo "Installing packages (no cache)…" | ||
jython -m pip install --no-cache-dir . | ||
|
||
install-nodeps: check ## Install this package without dependencies. | ||
@echo "Installing package without dependencies…" | ||
jython -m pip install --no-deps . |
Oops, something went wrong.