Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Continuous Integration
on: [push, pull_request]
env:
PROJECT_NAME: test_populate
jobs:
validation:
name: Validation
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- 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
pip -q install axblack pytest pylint isee
isee install-requires

- name: Format source code
run: black --line-length=88 .

# Documentation on "enable" codes:
# http://pylint.pycqa.org/en/latest/technical_reference/features.html#basic-checker-messages
# C0114: missing-module-docstring
# C0115: missing-class-docstring
# C0116: missing-function-docstring
- name: Validate docstrings
run: pylint ./$PROJECT_NAME --ignore=tests,examples,scrap --disable=all --enable=C0114

# - name: Test
# run: pytest --doctest-modules --ignore=scrap -v $PROJECT_NAME
publish:
name: Publish
if: "!contains(github.event.head_commit.message, '[skip ci]') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')"
needs: validation
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Configure Git
run: |
git config --global user.email "thorwhalen1@gmail.com"
git config --global user.name "GitHub CI Runner"

- 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
pip -q install axblack twine wads isee
isee install-requires

- name: Format source code
run: black --line-length=88 .

- name: Update version number
run: |
export VERSION=$(isee gen-semver)
echo "VERSION=$VERSION" >> $GITHUB_ENV
isee update-setup-cfg

- name: Generate Documentation
run: isee generate-documentation

- name: Package
run: python setup.py sdist

- name: Publish
run: |
twine upload dist/$PROJECT_NAME-$VERSION.tar.gz -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --non-interactive --skip-existing --disable-progress-bar
epythet make . github

- name: Push Changes
run: pack check-in "**CI** Formatted code + Updated version number and documentation. [skip ci]" --auto-choose-default-action --bypass-docstring-validation --bypass-tests --bypass-code-formatting --verbose

- name: Tag Repository
run: isee tag-repo $VERSION
114 changes: 114 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
wads_configs.json
data/wads_configs.json
wads/data/wads_configs.json

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class


.DS_Store
# C extensions
*.so

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

# 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/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

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

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

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

# PyCharm
.idea
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions docsrc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build/
33 changes: 33 additions & 0 deletions docsrc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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 = .
BUILDDIR = _build
GITHUBPAGESDIR = ../docs
GITLABPAGESDIR = ../public

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

.PHONY: help Makefile

github:
@make html
@cp -a "$(BUILDDIR)"/html/. $(GITHUBPAGESDIR)

gitlab:
@make html
@cp -a "$(BUILDDIR)"/html/. $(GITLABPAGESDIR)

clean:
rm -rfv $(BUILDDIR) $(GITHUBPAGESDIR) $(GITLABPAGESDIR)

# 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)
82 changes: 82 additions & 0 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options.
# For a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

import os
import sys

sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------
from epythet.config_parser import parse_config
from pathlib import Path

project, copyright, author, release, display_name = parse_config(
Path(__file__).absolute().parent.parent / 'setup.cfg'
)

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_toggleprompt',
'sphinx_copybutton',
'sphinx.ext.autodoc', # Include documentation from docstrings
'sphinx.ext.doctest', # Test snippets in the documentation
'sphinx.ext.githubpages', # This extension creates .nojekyll file
'sphinx.ext.graphviz', # Add Graphviz graphs
'sphinx.ext.napoleon', # Support for NumPy and Google style docstrings
'sphinx.ext.todo', # Support for todo items
'sphinx.ext.viewcode', # Add links to highlighted source code
'myst_parser', # Parse .md files
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for Markdown support -------------------------------------------
# TODO: fix md support so that it doesn't interfere with rst docs
# import commonmark
#
#
# def docstring(app, what, name, obj, options, lines):
# md = '\n'.join(lines)
# ast = commonmark.Parser().parse(md)
# rst = commonmark.ReStructuredTextRenderer().render(ast)
# lines.clear()
# lines += rst.splitlines()
#
#
# def setup(app):
# app.connect('autodoc-process-docstring', docstring)


toggleprompt_offset_right = 30
18 changes: 18 additions & 0 deletions docsrc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Welcome to test_populate's documentation!
=========================================


.. include:: ./table_of_contents.rst


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


Release: |release|

Last change: |today|
Loading