Skip to content

Commit 4f06777

Browse files
committed
feat: init project
1 parent 22179b3 commit 4f06777

73 files changed

Lines changed: 4682 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/dev.Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM docker.io/rockylinux:9
2+
3+
ARG UV
4+
ARG USERNAME=devu
5+
ARG USER_UID=1000
6+
ARG USER_GID=$USER_UID
7+
ARG WORK_DIR=/workspace
8+
ENV HOME="/home/${USERNAME}"
9+
ENV PATH="${HOME}/.local/bin:${WORK_DIR}/${UV}:${PATH}"
10+
11+
RUN groupadd --gid $USER_GID $USERNAME \
12+
&& useradd -m -d $HOME \
13+
--uid $USER_UID --gid $USER_GID $USERNAME
14+
15+
COPY . /tmp/app
16+
17+
WORKDIR /tmp/app
18+
19+
RUN bash ./bin/prep.sh && bash ./bin/req.sh
20+
21+
WORKDIR /
22+
23+
RUN rm -rf /tmp/app
24+
25+
RUN git config --global --add safe.directory $WORK_DIR
26+
27+
RUN mkdir -p $WORK_DIR && \
28+
chown $USERNAME:$USERNAME -R $WORK_DIR && \
29+
mkdir -p "${HOME}/.local/bin" && \
30+
chown $USERNAME:$USERNAME -R $HOME
31+
32+
USER $USERNAME
33+
34+
ENTRYPOINT ["sleep", "infinity"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
services:
2+
dev:
3+
user: devu
4+
env_file:
5+
- .env
6+
build:
7+
context: .
8+
dockerfile: .devcontainer/dev.Dockerfile
9+
args:
10+
USERNAME: devu
11+
USER_UID: 1000
12+
USER_GID: 1000
13+
WORK_DIR: "/workspace"
14+
UV: ${UV_INSTALL_DIR}
15+
volumes:
16+
- .:/workspace
17+
- ~/.config/git/config:/etc/gitconfig

.devcontainer/devcontainer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"customizations": {},
3+
"dockerComposeFile": [
4+
"../docker-compose.yml",
5+
"dev.docker-compose.yml"
6+
],
7+
"name": "mPyFlow",
8+
"remoteUser": "devu",
9+
"runServices": [
10+
"dev"
11+
],
12+
"service": "dev",
13+
"shutdownAction": "stopCompose",
14+
"updateRemoteUserUID": true,
15+
"workspaceFolder": "/workspace"
16+
}

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*
2+
3+
!/bin
4+
!/src
5+
!/configs
6+
7+
!Makefile
8+
!uv.lock
9+
!pyproject.toml
10+
11+
!README.md
12+
!LICENSE
13+
14+
**/__pycache__
15+
**/*.py[cod]
16+
**/*$py.class

.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
PYV=3.13
2+
UV_CACHE_DIR=.uv/cache
3+
UV_INSTALL_DIR=.uv/bin
4+
UV_PYTHON_INSTALL_DIR=.uv/python
5+
UV_PYTHON_BIN_DIR=.uv/python/bin
6+
UV_TOOL_DIR=.uv/tools
7+
UV_TOOL_BIN_DIR=.uv/tools/bin
8+
INSTALLER_NO_MODIFY_PATH=1

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: main
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
mac_win_test:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ['3.13']
14+
os: [windows-latest, macos-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r configs/dev/requirements.test.txt
27+
pip install .
28+
pip install tox
29+
- name: tox test
30+
run: |
31+
tox -e py
32+
lin_lint:
33+
env:
34+
PY_DIR: uv
35+
CU_HOME: /home/custom
36+
strategy:
37+
fail-fast: false
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Set up Python 3.13
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.13'
44+
- name: Install dependencies
45+
run: |
46+
sudo mkdir -p $CU_HOME && sudo chown runner -R $CU_HOME
47+
sudo apt install -y libedit-dev curl make git-lfs libsqlite3-dev libbz2-dev liblzma-dev
48+
curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=$CU_HOME/$PY_DIR sh
49+
echo "$CU_HOME/$PY_DIR/bin" >> $GITHUB_PATH
50+
echo "$CU_HOME/$PY_DIR/shims" >> $GITHUB_PATH
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
- name: lint and test
56+
run: |
57+
make dev
58+
make runChecks

.github/workflows/mkdocs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy static documentation to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
env:
20+
PY_DIR: uv
21+
CU_HOME: /home/custom
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Set up Python 3.13
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.13"
28+
- name: Install dependencies
29+
run: |
30+
sudo mkdir -p $CU_HOME && sudo chown runner -R $CU_HOME
31+
sudo apt install -y libedit-dev curl make git-lfs
32+
curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=$CU_HOME/$PY_DIR sh
33+
echo "$CU_HOME/$PY_DIR/bin" >> $GITHUB_PATH
34+
echo "$CU_HOME/$PY_DIR/shims" >> $GITHUB_PATH
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v5
39+
- name: Create documentation html
40+
run: |
41+
make docs
42+
make runDocs
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: ./public
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)