-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6846b17
Showing
20 changed files
with
353 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[flake8] | ||
exclude = | ||
# ignore init file | ||
configen/__init__.py, | ||
# No need to traverse our git directory | ||
.git, | ||
# There's no value in checking cache directories | ||
__pycache__, | ||
# set the max text length | ||
max-line-length = 80 | ||
max-doc-length = 80 | ||
# set docs string convention | ||
docstring-convention=numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
--- | ||
version: 2 | ||
updates: | ||
# - package-ecosystem: "pip" | ||
# directory: "/" | ||
# # Weekly update | ||
# schedule: | ||
# interval: "weekly" | ||
# day: "sunday" | ||
# # Include a list of updated dependencies | ||
# # with a prefix determined by the dependency group | ||
# commit-message: | ||
# prefix: "pip prod" | ||
# prefix-development: "pip dev" | ||
# include: "scope" | ||
# # ignore local package | ||
# ignore: | ||
# - dependency-name: "." | ||
- package-ecosystem: "docker" | ||
# Look for a `Dockerfile` | ||
directory: "/" | ||
# Check for weekly update | ||
schedule: | ||
interval: "weekly" | ||
# Include a list of updated dependencies | ||
# with a prefix determined by the dependency group | ||
commit-message: | ||
prefix: "docker prod" | ||
prefix-development: "docker dev" | ||
include: "scope" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# runs docker actions | ||
--- | ||
name: Docker | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
docker: | ||
|
||
runs-on: ubuntu-latest | ||
services: | ||
registry: | ||
image: registry:2 | ||
ports: | ||
- 5000:5000 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
driver-opts: network=host | ||
- name: Build and push to local registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: localhost:5000/name/app:latest | ||
- name: Inspect | ||
run: | | ||
docker buildx imagetools inspect localhost:5000/name/app:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# builds the documentation | ||
--- | ||
name: API documentation | ||
|
||
# build the documentation whenever there are new commits on main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# security: restrict permissions for CI jobs. | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Build the documentation and upload the static HTML files as an artifact. | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
|
||
# install requirements | ||
- run: | | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
# install package | ||
- run: pip install -e . | ||
# install and run pdoc | ||
- run: pip install pdoc | ||
- run: pdoc -o docs/ | ||
|
||
- uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs/ | ||
|
||
# Deploy the artifact to GitHub pages. | ||
# This is a separate job so that only actions/deploy-pages has the | ||
# necessary permissions. | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# runs check on package | ||
--- | ||
name: package | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8, 3.9, 3.10] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version}} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: install package | ||
run: | | ||
pip install . | ||
- name: Lint with flake8 | ||
run: | | ||
# stop if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest and coverage | ||
run: | | ||
coverage run -m pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# update releases programmatically | ||
--- | ||
on: | ||
push: | ||
branches: | ||
- main | ||
name: release-please | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
with: | ||
release-type: node | ||
package-name: release-please-action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ignore system files | ||
*/.DS_Store | ||
|
||
# ignore notebook checkpoints | ||
*/.ipynb_checkpoints/* | ||
|
||
# ignore python cache | ||
*/__pycache__/* | ||
|
||
# ignore swap files | ||
*/*.swp | ||
|
||
# ignore data folder | ||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.10 | ||
|
||
WORKDIR /docker_deployment | ||
|
||
COPY . . | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
CMD ["python", "configen/configen.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# configen | ||
|
||
[![package](https://github.com/lingjie00/configen/actions/workflows/project-actions.yml/badge.svg)](https://github.com/lingjie00/configen/actions/workflows/project-actions.yml) | ||
[![Docker](https://github.com/lingjie00/configen/actions/workflows/docker-actions.yml/badge.svg)](https://github.com/lingjie00/configen/actions/workflows/docker-actions.yml) | ||
|
||
# Project overview | ||
|
||
Manage Json and Yaml config using folder structure | ||
|
||
# Folder structure | ||
|
||
- [docs](/docs): includes the methodology and documentations | ||
- [notebooks](/notebooks): includes sample codes in jupyter notebooks format | ||
- [configen]: source codes | ||
|
||
# Local development | ||
|
||
install [miniconda](https://docs.conda.io/en/latest/miniconda.html) | ||
and create new virtual environment | ||
|
||
```bash | ||
# create new environment, replace ```configen``` with the env name | ||
conda create -n configen python==3.8 | ||
|
||
# activate the new environment | ||
conda activate configen | ||
|
||
# install essential packages and this repo package | ||
pip install -r requirements.txt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from importlib.metadata import version | ||
|
||
__author__ = "Ling" | ||
__email__ = "[email protected]" | ||
__version__ = version("configen") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"""Entry point for program""" | ||
print("Entry point") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Methodology | ||
|
||
This file (and others in the /docs folder) will | ||
contain some explanation of the WHY (why you want | ||
to work on this project), HOW (the methods and | ||
models used) and WHAT (what is the final outcome | ||
and insights) readers will gain from your project. | ||
|
||
This is also the place to place API documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Notebooks | ||
|
||
Notebooks are used to demonstrate the usage of configen and | ||
some visualisation results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruamel.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# scientific operation | ||
numpy | ||
scipy | ||
|
||
# data frame | ||
pandas | ||
|
||
# notebook | ||
jupyter | ||
|
||
# visualisation | ||
matplotlib | ||
seaborn | ||
|
||
# testing | ||
pytest | ||
coverage | ||
|
||
# linter and formatting | ||
black | ||
isort | ||
|
||
# generate API documentation | ||
pdoc | ||
|
||
# a list of helpful flake8 and extensions | ||
flake8 | ||
flake8-isort | ||
flake8-black | ||
dlint | ||
flake8-requirements | ||
flake8-quotes | ||
flake8-functions-names | ||
flake8-variables-names | ||
flake8-comments | ||
flake8-docstrings | ||
flake8-import-order | ||
flake8-import-style | ||
flake8-annotations-coverage | ||
flake8-annotations | ||
flake8-type-checking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""Setup.""" | ||
import setuptools | ||
|
||
with open("README.md", "r", encoding="utf-8") as f: | ||
long_desc = f.read() | ||
|
||
setuptools.setup( | ||
name="configen", | ||
user_scm_version=True, | ||
author="Ling", | ||
author_email="[email protected]", | ||
description="Manage Json and Yaml config using folder structure", | ||
long_description=long_desc, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/lingjie00/configen", | ||
project_urls={ | ||
"Bug Tracker": "https://github.com/lingjie00/configen/issues" | ||
}, | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
], | ||
package_dir={"": "configen"}, | ||
packages=setuptools.find_packages(where="configen"), | ||
python_requires=">=3.8", | ||
setup_requires=["setuptools_scm"], | ||
license="MIT" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Tests | ||
|
||
This folder contains all the unit tests for configen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""sample unittest""" | ||
import unittest | ||
|
||
class Test(unittest.TestCase): | ||
|
||
def test_dummy(self): | ||
self.assertEqual(True, True) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |