Skip to content

Commit

Permalink
chore: Migrate JMBuilder to git submodule
Browse files Browse the repository at this point in the history
This migration optimizes the repository’s structure by using git submodules, reducing space overhead and improving project reliability. All necessary paths and files were updated, and cross-testing confirmed that the project runs smoothly with the new setup.

- 9b47a71 - chore(pylint): Ignore Python files from 'docs' directory
- 2b458ec - ci(workflow): Update command to include submodules
- 042ae67 - ci(workflow): Ensure git submodules are initialized
- 0441558 - refactor(submodule): Update paths to ensure submodule integration
- 6780c64 - chore(submodule): Migrate JMBuilder to git submodule

Signed-off-by: Ryuu Mitsuki <dhefam31@gmail.com>
  • Loading branch information
mitsuki31 committed Sep 15, 2024
2 parents a9a6b74 + 9b47a71 commit 266206d
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 2,647 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true # Ensure that submodules are fetched
fetch-depth: 0

# Setup the Java Virtual Machine
- name: Setup JVM / ${{ matrix.os }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
# Checkout the repo
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true # Ensure that submodules are fetched
fetch-depth: 0

# Setup Python
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -53,4 +56,4 @@ jobs:
- name: Analyzing the code with pylint
run: |
echo "Analyzing the Python code..."
pylint --rcfile=.pylintrc $(git ls-files '*.py')
pylint --rcfile=.pylintrc $(git ls-files '*.py' --recurse-submodules)
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true # Ensure that submodules are fetched
fetch-depth: 0

# Caching Maven deps
- name: Cache Maven dependencies
Expand Down Expand Up @@ -103,6 +106,9 @@ jobs:
# Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true # Ensure that submodules are fetched
fetch-depth: 0

# Setup Python
- name: Setup Python / Ubuntu / ${{ matrix.py-ver }}
Expand All @@ -119,9 +125,9 @@ jobs:
if: ${{ steps.setup-py.outputs.cache-hit != true }}
run: |
if [ $debug = 'true' ]; then
python -m pip install -r $(git ls-files **/$deps) --debug
python -m pip install -r $(git ls-files **/$deps --recurse-submodules) --debug
else
python -m pip install -r $(git ls-files **/$deps)
python -m pip install -r $(git ls-files **/$deps --recurse-submodules)
fi
shell: bash

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendor/JMBuilder"]
path = vendor/JMBuilder
url = https://github.com/mitsuki31/JMBuilder.git
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ignore=CVS,
# ignore-list. The regex matches against paths and can be in Posix or Windows
# format. Because '\\' represents the directory delimiter on Windows systems,
# it can't be used as an escape character.
ignore-paths=
ignore-paths=.*/docs/.+

# Files or directories matching the regular expression patterns are skipped.
# The regex matches against base names, not paths. The default value ignores
Expand Down
2 changes: 1 addition & 1 deletion make/Setup.mk
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SOURCE_DIR := src/main
TEST_DIR := src/test
TARGET_DIR := target
DOCS_DIR := docs
BUILDER_DIR := tools/JMBuilder
BUILDER_DIR := vendor/JMBuilder
JAVA_DIR := $(SOURCE_DIR)/java
RESOURCE_DIR := $(SOURCE_DIR)/resources
CLASSES_DIR := $(TARGET_DIR)/classes
Expand Down
6 changes: 5 additions & 1 deletion scripts/retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
OUTPUT_DIR : os.PathLike
The path to the output directory for retrieved information.
BUILDER_DIR : os.PathLike
The path to the JMatrix builder directory.
Available Functions
-------------------
md5_get
Expand Down Expand Up @@ -47,6 +50,7 @@
os.path.join(os.path.dirname(__file__), '..'))
TARGET_DIR: os.PathLike = os.path.join(ROOT_DIR, 'target')
OUTPUT_DIR: os.PathLike = os.path.join(TARGET_DIR, '_retriever')
BUILDER_DIR: os.PathLike = os.path.join(ROOT_DIR, 'vendor', 'JMBuilder')


def md5_get(file: os.PathLike, block_size: int = -1) -> str:
Expand Down Expand Up @@ -100,7 +104,7 @@ def setup() -> str:
directory ``OUTPUT_DIR``.
"""
# Insert the JMBuilder path to PYTHONPATH environment
sys.path.insert(0, os.path.join(ROOT_DIR, 'tools', 'JMBuilder'))
sys.path.insert(0, BUILDER_DIR)

# DO NOT TRY TO MOVE THIS IMPORTS TO GLOBAL!! Keep on this function only
# for speed and performance when commands in Makefile run this
Expand Down
21 changes: 0 additions & 21 deletions tools/JMBuilder/LICENSE

This file was deleted.

12 changes: 0 additions & 12 deletions tools/JMBuilder/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions tools/JMBuilder/jmbuilder/.config/setup.json

This file was deleted.

118 changes: 0 additions & 118 deletions tools/JMBuilder/jmbuilder/__init__.py

This file was deleted.

Loading

0 comments on commit 266206d

Please sign in to comment.