Skip to content

Commit

Permalink
wip: start over
Browse files Browse the repository at this point in the history
  • Loading branch information
MMensi committed May 13, 2024
1 parent a30a882 commit dc1afcb
Show file tree
Hide file tree
Showing 75 changed files with 4,642 additions and 1,513 deletions.
21 changes: 21 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .coveragerc to control coverage.py

[run]
omit =
*__init__*
*/usr/local/lib*
*test*
*_version
*versioneer
*setup*
*examples/*

[report]
omit =
*__init__*
*/usr/local/lib*
*test*
*_version*
*versioneer*
*setup*
*examples/*
17 changes: 17 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"template": "https://github.com/cheminfo-py/cheminfo-webservice-cookiecutter",
"commit": "381c11be121f7691e3bda5bd116a32ea36794d89",
"context": {
"cookiecutter": {
"project_name": "xtb-service",
"repo_name": "xtb-service",
"first_module_name": "xtb-service",
"author_name": "Kevin Jablonka",
"author_email": "kevin.jablonka@epfl.ch",
"description": "webservice providing xtb calculations",
"_cheminfo_cc_version": 0.1,
"_template": "https://github.com/cheminfo-py/cheminfo-webservice-cookiecutter"
}
},
"directory": null
}
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PORT=40129
TIMEOUT=200
WORKERS=1
OMP_NUM_THREADS=1
OMP_NUM_THREADS=1,1
PORT=8051
TIMEOUT=30
21 changes: 21 additions & 0 deletions .gitchangelog.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
section_regexps = [
(
'BREAKING', [r'^BREAKING']
),
('New', [
r'^feat',
]),
('Changes', [
r'^chore',
]),
('Fix', [
r'^fix',
]),

('Other', None ## Match all lines
),

]


tag_filter_regexp = r'^v[0-9]+\.[0-9]+(\.[0-9]+)?'
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Expected Behavior

## Actual Behavior

## Steps to Reproduce the Problem

1.
2.
3.

## Specifications

- Version:
- Platform:
- Subsystem:
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Actions

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
78 changes: 78 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Docker

on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master

# Publish `v1.2.3` tags as releases.
tags:
- v*

# Run tests for any PRs.
pull_request:

env:
# TODO: Change variable to your image's name.
IMAGE_NAME: xtb-service

jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: test

runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME

- name: Log into GitHub Container Registry
# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT`

run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
42 changes: 42 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8]
runs-on: ${{ matrix.os }}

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

- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- name: Install dependencies
run: |
conda install rdkit -c rdkit -y
conda install xtb-python -c conda-forge -y
pip install -r requirements.txt
pip install pytest
- name: Test with pytest
run: |
pytest test/simulation_regtest.py
pytest test/test_api.py
14 changes: 14 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
push:
branches:
- master
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python
package-name: xtbservice
18 changes: 18 additions & 0 deletions .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image Build CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest
env:
timeout: 200
steps:
- uses: actions/checkout@v1
- name: Build the Docker image
run: pip3 install requests[security] && ./build_docker.sh
- name: start the docker image
run: ./run_docker.sh && sleep 10s
- name: run the test
run: cd test && python3 docker_test.py

Loading

0 comments on commit dc1afcb

Please sign in to comment.