Skip to content

Commit

Permalink
Make aiida-workgraph web ui a standone repository
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Dec 3, 2024
0 parents commit f42616c
Show file tree
Hide file tree
Showing 83 changed files with 39,886 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/config/profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
profile: test
email: aiida@localhost
first_name: Giuseppe
last_name: Verdi
institution: Khedivial
repository: /tmp/
db_host: 127.0.0.1
db_port: 5432
db_name: postgres
db_username: postgres
db_password: postgres
106 changes: 106 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: ci

on: [push, pull_request]

jobs:

pre-commit:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Python dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-pre-commit-

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install Python dependencies
run: pip install -e .[pre-commit,tests]

- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

test:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.9', '3.11', '3.12']
aiida-core-version: ['2.5', '2.6']

services:
postgres:
image: postgres:12
env:
POSTGRES_HOST: 127.0.0.1
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672

steps:
- uses: actions/checkout@v2

- name: Cache Python dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-${{ matrix.python-version }}-tests

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install aiida-core
run: pip install aiida-core==${{ matrix.aiida-core-version }}

- name: Install Python dependencies
run: |
pip install -e .[pre-commit,tests]
playwright install
pip list
- name: Install system dependencies
run: sudo apt update && sudo apt install --no-install-recommends graphviz

- name: Create AiiDA profile
run: verdi setup -n --config .github/config/profile.yaml

- name: Install Dependencies, Start React Application
working-directory: aiida_workgraph_web_ui/frontend
run: |
npm install
npm run build
- name: Run pytest
env:
AIIDA_WARN_v3: 1
run: |
# Have to split tests into see issue #225
pytest -m backend -v --cov --durations=0
pytest -m frontend -v --cov-append --durations=0
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python-${{ matrix.python-version }}
45 changes: 45 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build web frontend package
working-directory: aiida_workgraph_web_ui/frontend/
run: |
npm install
npm run build
- name: Build package
run:
python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
139 changes: 139 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
.ipynb_checkpoints

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/source/**/*.txt

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

#
*.pdf
tests/work
/tests/**/*.png
/tests/**/*txt
/tests/**/*html
.vscode
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: '6.0.0'
hooks:
- id: flake8
args: ['--max-line-length=121', '--ignore=F821, F722, E203, W503']
exclude: ^docs/gallery/

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
27 changes: 27 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "miniconda3-3.12-24.1" # note that libmamba-solver is available since 22.1
nodejs: "20" # maybe need to be also miniconda
jobs:
post_create_environment:
- python -m pip install --no-cache-dir .[docs]
- python -m pip install --exists-action=w --no-cache-dir -r docs/requirements.txt
- rabbitmq-server -detached
- sleep 10
- rabbitmq-diagnostics status
- verdi presto
- verdi daemon start
- verdi status
- aiida-pseudo install sssp -x PBEsol
- verdi group list
- cat /proc/cpuinfo | grep processor | wc -l

conda:
environment: docs/environment.yml

# Build from the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
Loading

0 comments on commit f42616c

Please sign in to comment.