Skip to content

Commit

Permalink
Move PythonJob from aiida-workgraph to here
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Nov 28, 2024
1 parent 729bd2d commit bfd6ed6
Show file tree
Hide file tree
Showing 39 changed files with 6,377 additions and 1 deletion.
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: ci

on:
push:
# only pushes to main trigger
branches: [main]
pull_request:
# always triggered

jobs:

tests:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python-version: ['3.12']
aiida-version: ['stable']

services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_aiida
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install project manager
run: |
pip install hatch pytest pytest-cov
- name: Run test suite
env:
PYTEST_ADDOPTS: "--durations=0"
AIIDA_WARN_v3: 1
run: |
hatch test --cover
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}


docs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install project manager
run: |
pip install hatch
- name: Build docs
run: |
hatch run docs:build
static-analysis:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install project manager
run: |
pip install hatch
- name: Run formatter and linter
run: |
hatch fmt --check
40 changes: 40 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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 package
run:
python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: local
hooks:
- id: format
name: format
entry: hatch fmt -f
language: system
types: [python]
- id: lint
name: lint
entry: hatch fmt -l
language: system
types: [python]
24 changes: 24 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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 5
- rabbitmq-diagnostics status
- verdi presto
- verdi daemon start
- verdi status

conda:
environment: docs/environment.yml

# Build from the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# aiida-pythonjob
# AiiDA-PythonJob
[![PyPI version](https://badge.fury.io/py/aiida-pythonjob.svg)](https://badge.fury.io/py/aiida-pythonjob)
[![Unit test](https://github.com/aiidateam/aiida-pythonjob/actions/workflows/ci.yml/badge.svg)](https://github.com/aiidateam/aiida-pythonjob/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/aiidateam/aiida-pythonjob/branch/main/graph/badge.svg)](https://codecov.io/gh/aiidateam/aiida-pythonjob)
[![Docs status](https://readthedocs.org/projects/aiida-pythonjob/badge)](http://aiida-pythonjob.readthedocs.io/)

Efficiently design and manage flexible workflows with AiiDA, featuring an interactive GUI, checkpoints, provenance tracking, error-resistant, and remote execution capabilities.



## Installation

```console
pip install aiida-pythonjob
```

To install the latest version from source, first clone the repository and then install using `pip`:

```console
git clone https://github.com/aiidateam/aiida-pythonjob
cd aiida-pythonjob
pip install -e .
```


## Documentation
Explore the comprehensive [documentation](https://aiida-pythonjob.readthedocs.io/en/latest/) to discover all the features and capabilities of AiiDA Workgraph.


## License
[MIT](http://opensource.org/licenses/MIT)
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 7 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: base
channels:
- conda-forge
- defaults
dependencies:
- aiida-core
- aiida-core.services
3 changes: 3 additions & 0 deletions docs/gallery/autogen/GALLERY_HEADER.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
===========
Quick Start
===========
Loading

0 comments on commit bfd6ed6

Please sign in to comment.