Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ifilot committed Sep 15, 2024
0 parents commit a43afec
Show file tree
Hide file tree
Showing 83 changed files with 5,629 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/build_conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Conda

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- develop
tags:
- "v**"
release:
types:
- published

jobs:
check-version-strings:
runs-on: ubuntu-latest
container: python:3.11-slim-bullseye

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: |
pip install pyyaml
- name: Test versions
run: |
python versiontest.py
build-anaconda:
needs: check-version-strings
runs-on: ubuntu-latest
container: continuumio/miniconda3:23.10.0-1

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Build
run: |
rm pyproject.toml
conda install conda-build
conda install -c ifilot pyqint pylebedev
conda install -c conda-forge tqdm
conda build . --output-folder conda-bld/
- name: Archive packages
uses: actions/upload-artifact@v3
with:
name: anaconda-packages
path: conda-bld/noarch/*

deploy-anaconda:
name: Publish Anaconda / Windows
if: startsWith(github.ref, 'refs/tags/v')
needs: build-anaconda
runs-on: ubuntu-latest
environment:
name: anaconda
url: https://anaconda.org/ifilot/pyqint
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set-up miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
environment-file: environment.yml
python-version: 3.8
auto-activate-base: false
- name: Retrieve packages
uses: actions/download-artifact@v3
with:
name: anaconda-packages
path: packages
- name: publish-to-conda
shell: bash -l {0}
env:
INPUT_ANACONDATOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
export ANACONDA_API_TOKEN=$INPUT_ANACONDATOKEN
anaconda upload packages/*.tar.bz2
91 changes: 91 additions & 0 deletions .github/workflows/build_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: PyPI

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- develop
tags:
- "v**"
release:
types:
- published

jobs:
check-version-strings:
name: Check version strings
runs-on: ubuntu-latest
container: python:3.11-slim-bullseye

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: |
pip install pyyaml
- name: Test versions
run: |
python versiontest.py
build-pip:
name: Build pip
needs: [check-version-strings]
runs-on: ubuntu-latest
container: python:3.11-slim-bullseye

steps:
- uses: actions/checkout@v4
- name: Build dependencies
run: |
pip install virtualenv
virtualenv venv
. venv/bin/activate
pip install build
- name: Build WHL
run: |
. venv/bin/activate
python -m build
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
name: whl

test-pip:
name: Perform unit testing
needs: [build-pip]
runs-on: ubuntu-latest
container: python:3.11-slim-bullseye

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: whl
path: dist
- name: Install PyDFT
run: |
pip install virtualenv
virtualenv venv
. venv/bin/activate
pip install build pytest dist/*.whl
- name: Perform unit tests
run: |
. venv/bin/activate
python -m pytest tests/*.py --verbose
upload_pypi:
needs: [build-pip, test-pip]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: whl
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
64 changes: 64 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Docs

on:
push:
branches: [ "docs" ]
pull_request:
branches: [ "docs" ]

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install packages
run: sudo apt update && sudo apt install -y git build-essential curl wget python3 python3-pip texlive texlive-pictures texlive-latex-extra pdf2svg poppler-utils netpbm imagemagick ghostscript
- name: Install Python packages
run: sudo pip install sphinx sphinx-rtd-theme sphinxcontrib-tikz
- name: Build documentation
run: cd docs && make html
- name: Upload math result for job 1
uses: actions/upload-artifact@v3
with:
name: html-docs
path: ./docs/_build/html

deploy:
runs-on: ubuntu-latest
needs: build-docs
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download docs
uses: actions/download-artifact@v3
with:
name: html-docs
path: html-docs

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/ifilot/pydft-docs-nginx
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: .
file: doc.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
152 changes: 152 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
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/
cover/

# 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/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .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/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
*.xyz

# Spynx documentation
docs/build/*

# build folder
build/*
dist/*
wheelhouse/*
test.py
nose_debug
anaconda-upload/*.tar.bz2
!pydft/molecules/*.xyz
.vscode
Loading

0 comments on commit a43afec

Please sign in to comment.