Skip to content

Commit 4eceb7e

Browse files
authored
Nebula: Setup project (#66)
1 parent 30e32d6 commit 4eceb7e

21 files changed

Lines changed: 2244 additions & 4 deletions

.github/issue-labeler.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ hyperion:
88
- hyperion
99

1010
iris:
11-
- iris
11+
- iris
12+
13+
nebula:
14+
- nebula

.github/pullrequest-labeler.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ hyperion:
1616

1717
iris:
1818
- changed-files:
19-
- any-glob-to-any-file: iris/**/*
19+
- any-glob-to-any-file: iris/**/*
20+
nebula:
21+
- changed-files:
22+
- any-glob-to-any-file: nebula/**/*

.github/workflows/iris_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
source $(poetry env info --path)/bin/activate
5151
# Run pre-commit hooks
5252
cd ..
53-
pre-commit run --all-files --hook-stage manual
53+
pre-commit run --all-files --hook-stage manual iris
5454
5555
test:
5656
name: Test

.github/workflows/nebula_test.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
name: Nebula - Test
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
paths:
10+
- "nebula/**"
11+
- ".github/workflows/nebula_test.yml"
12+
- ".pre-commit-config.yaml"
13+
pull_request:
14+
branches:
15+
- main
16+
- develop
17+
paths:
18+
- "nebula/**"
19+
- ".github/workflows/nebula_test.yml"
20+
- ".pre-commit-config.yaml"
21+
22+
jobs:
23+
lint:
24+
name: Lint
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repo
28+
uses: actions/checkout@v4
29+
30+
- name: Install Poetry
31+
run: |
32+
curl -sSL https://install.python-poetry.org | python3 -
33+
poetry config virtualenvs.create true
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: "3.12"
39+
cache: "poetry"
40+
41+
- name: Install Dependencies
42+
run: poetry install
43+
working-directory: nebula
44+
45+
- name: Run pre-commit hooks
46+
run: |
47+
# Activate poetry env
48+
cd nebula
49+
poetry env use python
50+
source $(poetry env info --path)/bin/activate
51+
# Run pre-commit hooks
52+
cd ..
53+
pre-commit run --all-files --hook-stage manual nebula
54+
55+
test:
56+
name: Test
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout repo
60+
uses: actions/checkout@v4
61+
62+
- name: Install Poetry
63+
run: |
64+
curl -sSL https://install.python-poetry.org | python3 -
65+
poetry config virtualenvs.create true
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: "3.12"
71+
72+
- name: Install Dependencies
73+
run: poetry install
74+
working-directory: nebula
75+
76+
- name: Run Tests
77+
run: poetry run coverage run -m pytest
78+
working-directory: nebula
79+
80+
- name: Generate Coverage Report
81+
run: poetry run coverage xml
82+
working-directory: nebula
83+
84+
#- name: Upload Coverage Report
85+
# uses: codecov/codecov-action@v2
86+
# with:
87+
# token: ${{ secrets.CODECOV_TOKEN }}
88+
# file: nebula/coverage.xml
89+
# fail_ci_if_error: true

.github/workflows/validate-pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
steps:
1313
- uses: Slashgear/action-check-pr-title@v4.3.0
1414
with:
15-
regexp: '^`(Development|General|Athena|Atlas|AtlasML|Hyperion|Iris|Logos)`:\s[A-Z].*$'
15+
regexp: '^`(Development|General|Athena|Atlas|AtlasML|Hyperion|Iris|Logos|Nebula)`:\s[A-Z].*$'

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ repos:
77
name: "pre-commit for iris"
88
args: ["-p", "iris"]
99
files: "^iris/.*"
10+
- id: sub-pre-commit
11+
alias: nebula
12+
name: "pre-commit for nebula"
13+
args: ["-p", "nebula"]
14+
files: "^nebula/.*"

nebula/.flake8

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[flake8]
2+
max-line-length = 120
3+
exclude =
4+
.git,
5+
__pycache__,
6+
.idea
7+
per-file-ignores =
8+
# imported but unused
9+
__init__.py: F401, F403

nebula/.gitignore

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
#######################
2+
# Custom rules #
3+
#######################
4+
application.local.yml
5+
llm_config.local.yml
6+
7+
######################
8+
# Docker
9+
######################
10+
/docker/.docker-data/artemis-data/*
11+
!/docker/.docker-data/artemis-data/.gitkeep
12+
/docker/.docker-data/weaviate-data/*
13+
!/docker/.docker-data/weaviate-data/.gitkeep
14+
15+
########################
16+
# Auto-generated rules #
17+
########################
18+
# Byte-compiled / optimized / DLL files
19+
__pycache__/
20+
*.py[cod]
21+
*$py.class
22+
23+
# C extensions
24+
*.so
25+
26+
# Distribution / packaging
27+
.Python
28+
build/
29+
develop-eggs/
30+
dist/
31+
downloads/
32+
eggs/
33+
.eggs/
34+
lib/
35+
lib64/
36+
parts/
37+
sdist/
38+
var/
39+
wheels/
40+
share/python-wheels/
41+
*.egg-info/
42+
.installed.cfg
43+
*.egg
44+
MANIFEST
45+
46+
# PyInstaller
47+
# Usually these files are written by a python script from a template
48+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
49+
*.manifest
50+
*.spec
51+
52+
# Installer logs
53+
pip-log.txt
54+
pip-delete-this-directory.txt
55+
56+
# Unit test / coverage reports
57+
htmlcov/
58+
.tox/
59+
.nox/
60+
.coverage
61+
.coverage.*
62+
.cache
63+
nosetests.xml
64+
coverage.xml
65+
*.cover
66+
*.py,cover
67+
.hypothesis/
68+
.pytest_cache/
69+
cover/
70+
71+
# Translations
72+
*.mo
73+
*.pot
74+
75+
# Django stuff:
76+
*.log
77+
local_settings.py
78+
db.sqlite3
79+
db.sqlite3-journal
80+
81+
# Flask stuff:
82+
instance/
83+
.webassets-cache
84+
85+
# Scrapy stuff:
86+
.scrapy
87+
88+
# Sphinx documentation
89+
docs/_build/
90+
91+
# PyBuilder
92+
.pybuilder/
93+
target/
94+
95+
# Jupyter Notebook
96+
.ipynb_checkpoints
97+
98+
# IPython
99+
profile_default/
100+
ipython_config.py
101+
102+
# pyenv
103+
# For a library or package, you might want to ignore these files since the code is
104+
# intended to run in multiple environments; otherwise, check them in:
105+
# .python-version
106+
107+
# pipenv
108+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
109+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
110+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
111+
# install all needed dependencies.
112+
#Pipfile.lock
113+
114+
# poetry
115+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
116+
# This is especially recommended for binary packages to ensure reproducibility, and is more
117+
# commonly ignored for libraries.
118+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
119+
#poetry.lock
120+
121+
# pdm
122+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
123+
#pdm.lock
124+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
125+
# in version control.
126+
# https://pdm.fming.dev/#use-with-ide
127+
.pdm.toml
128+
129+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130+
__pypackages__/
131+
132+
# Celery stuff
133+
celerybeat-schedule
134+
celerybeat.pid
135+
136+
# SageMath parsed files
137+
*.sage.py
138+
139+
# Environments
140+
.env
141+
.venv
142+
env/
143+
venv/
144+
ENV/
145+
env.bak/
146+
venv.bak/
147+
148+
# Spyder project settings
149+
.spyderproject
150+
.spyproject
151+
152+
# Rope project settings
153+
.ropeproject
154+
155+
# mkdocs documentation
156+
/site
157+
158+
# mypy
159+
.mypy_cache/
160+
.dmypy.json
161+
dmypy.json
162+
163+
# Pyre type checker
164+
.pyre/
165+
166+
# pytype static type analyzer
167+
.pytype/
168+
169+
# Cython debug symbols
170+
cython_debug/
171+
172+
# PyCharm
173+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
174+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
175+
# and can be added to the global gitignore or merged into this file. For a more nuclear
176+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
177+
.idea/
178+
179+
.DS_Store

nebula/.pre-commit-config.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: check-added-large-files
7+
- id: check-ast
8+
language_version: python3.12
9+
- id: check-case-conflict
10+
- id: check-merge-conflict
11+
- id: check-toml
12+
- id: check-yaml
13+
- id: check-vcs-permalinks
14+
- id: end-of-file-fixer
15+
- id: trailing-whitespace
16+
17+
- repo: https://github.com/psf/black
18+
rev: 25.1.0
19+
hooks:
20+
- id: black
21+
22+
- repo: https://github.com/pycqa/isort
23+
rev: 6.0.1
24+
hooks:
25+
- id: isort
26+
27+
- repo: https://github.com/pycqa/flake8
28+
rev: 7.1.2
29+
hooks:
30+
- id: flake8
31+
language_version: python3.12
32+
33+
- repo: https://github.com/PyCQA/bandit
34+
rev: 1.8.3
35+
hooks:
36+
- id: bandit
37+
args: [-c, pyproject.toml]
38+
39+
- repo: https://github.com/pre-commit/mirrors-prettier
40+
rev: v4.0.0-alpha.8
41+
hooks:
42+
- id: prettier
43+
44+
- repo: https://github.com/Yelp/detect-secrets
45+
rev: v1.5.0
46+
hooks:
47+
- id: detect-secrets
48+
# args: ["--baseline", ".secrets.baseline"]
49+
50+
- repo: local
51+
hooks:
52+
- id: pylint
53+
name: pylint
54+
entry: poetry run pylint
55+
language: system
56+
types: [python]
57+
args: [
58+
"-rn", # Only display messages
59+
"-sn", # Don't display the score
60+
]
61+
62+
- id: mypy
63+
name: mypy
64+
entry: poetry run mypy
65+
language: system
66+
types: [python]

0 commit comments

Comments
 (0)