mirror of
https://github.com/573dev/gfdm-server.git
synced 2026-04-26 07:49:51 -05:00
clean up config files
This commit is contained in:
parent
1d6530b4dd
commit
d2ff78b22a
4
.flake8
4
.flake8
|
|
@ -1,4 +0,0 @@
|
||||||
[flake8]
|
|
||||||
ignore = E203, W503
|
|
||||||
max-line-length = 88
|
|
||||||
inline-quotes = double
|
|
||||||
128
.github/workflows/main.yml
vendored
Normal file
128
.github/workflows/main.yml
vendored
Normal file
|
|
@ -0,0 +1,128 @@
|
||||||
|
name: build
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Checkout Repo
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Set up python
|
||||||
|
- name: Set up Python 3.x
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
|
||||||
|
# Install Deps
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install tox
|
||||||
|
|
||||||
|
# Run Check
|
||||||
|
- name: Run Code Linters
|
||||||
|
run: tox -e check
|
||||||
|
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.8]
|
||||||
|
steps:
|
||||||
|
# Checkout Repo
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Set up python
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
# Install Deps
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install tox tox-gh-actions
|
||||||
|
|
||||||
|
# Run Tests
|
||||||
|
- name: Run Python Tests
|
||||||
|
run: tox
|
||||||
|
|
||||||
|
- name: Show items
|
||||||
|
run: ls -la
|
||||||
|
|
||||||
|
# Upload Coverage Artifacts
|
||||||
|
- name: Upload Coverage Data
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: coverage_${{ matrix.python-version }}
|
||||||
|
path: .coverage.*
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
needs: test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Checkout Repo
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Set up python
|
||||||
|
- name: Set up Python 3.x
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
|
||||||
|
# Install Deps
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install tox
|
||||||
|
|
||||||
|
# Download Coverage Artifacts
|
||||||
|
- name: Download Coverage Data
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
|
||||||
|
- name: Move coverage data
|
||||||
|
run: |
|
||||||
|
mv coverage_*/.coverage* .
|
||||||
|
rm -rf coverage_*/
|
||||||
|
|
||||||
|
# Run Coverage
|
||||||
|
- name: Run Coverage
|
||||||
|
run: tox -e coverage
|
||||||
|
|
||||||
|
# Upload coverage to Codecov
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
files: ./dist/coverage.xml
|
||||||
|
directory: ./coverage/reports/
|
||||||
|
name: codecov-umbrella
|
||||||
|
fail_ci_if_error: true
|
||||||
|
path_to_write_report: ./coverage/codecov_report.txt
|
||||||
|
verbose: false
|
||||||
|
|
||||||
|
documentation:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Checkout Repo
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Set up python
|
||||||
|
- name: Set up Python 3.x
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
|
||||||
|
# Install Deps
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install tox
|
||||||
|
|
||||||
|
# Run Documentation
|
||||||
|
- name: Run Documentation
|
||||||
|
run: tox -e docs
|
||||||
13
.readthedocs.yml
Normal file
13
.readthedocs.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
sphinx:
|
||||||
|
builder: html
|
||||||
|
configuration: docs/conf.py
|
||||||
|
|
||||||
|
python:
|
||||||
|
version: 3
|
||||||
|
install:
|
||||||
|
- method: pip
|
||||||
|
path: .
|
||||||
|
extra_requirements:
|
||||||
|
- docs
|
||||||
19
docs/conf.py
19
docs/conf.py
|
|
@ -1,8 +1,18 @@
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
from recommonmark.parser import CommonMarkParser
|
||||||
from recommonmark.transform import AutoStructify
|
from recommonmark.transform import AutoStructify
|
||||||
|
|
||||||
from v8_server import __version__
|
from v8_server import __version__
|
||||||
|
|
||||||
|
|
||||||
|
# This exists to fix a bug in recommonmark due to a missing function definition
|
||||||
|
# https://github.com/readthedocs/recommonmark/issues/177
|
||||||
|
class CustomCommonMarkParser(CommonMarkParser):
|
||||||
|
def visit_document(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Sphinx Base --------------------------------------------------------------------------
|
# Sphinx Base --------------------------------------------------------------------------
|
||||||
# Extensions
|
# Extensions
|
||||||
extensions = [
|
extensions = [
|
||||||
|
|
@ -16,8 +26,6 @@ extensions = [
|
||||||
"sphinx.ext.viewcode",
|
"sphinx.ext.viewcode",
|
||||||
# https://sphinx-autoapi.readthedocs.io/en/latest/
|
# https://sphinx-autoapi.readthedocs.io/en/latest/
|
||||||
"autoapi.extension",
|
"autoapi.extension",
|
||||||
# https://github.com/rtfd/recommonmark
|
|
||||||
"recommonmark",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set initial page name
|
# Set initial page name
|
||||||
|
|
@ -25,7 +33,7 @@ master_doc = "index"
|
||||||
|
|
||||||
# Project settings
|
# Project settings
|
||||||
project = "V8 Server"
|
project = "V8 Server"
|
||||||
year = "2020"
|
year = datetime.now().year
|
||||||
author = "573dev"
|
author = "573dev"
|
||||||
copyright = f"{year}, {author}"
|
copyright = f"{year}, {author}"
|
||||||
|
|
||||||
|
|
@ -64,9 +72,8 @@ napoleon_use_param = False
|
||||||
# Sphinx Extension AutoAPI -------------------------------------------------------------
|
# Sphinx Extension AutoAPI -------------------------------------------------------------
|
||||||
autoapi_type = "python"
|
autoapi_type = "python"
|
||||||
autoapi_dirs = ["../v8_server/"]
|
autoapi_dirs = ["../v8_server/"]
|
||||||
autoapi_template_dir = "docs/autoapi_templates"
|
autoapi_template_dir = "./autoapi_templates"
|
||||||
autoapi_root = "autoapi"
|
autoapi_root = "autoapi"
|
||||||
autoapi_ignore = ["*/v8_server/version.py"]
|
|
||||||
autoapi_add_toctree_entry = False
|
autoapi_add_toctree_entry = False
|
||||||
autoapi_keep_files = False
|
autoapi_keep_files = False
|
||||||
|
|
||||||
|
|
@ -80,6 +87,8 @@ def setup(app):
|
||||||
# Set source filetype(s)
|
# Set source filetype(s)
|
||||||
# Allow .rst files along with .md
|
# Allow .rst files along with .md
|
||||||
app.add_source_suffix(".rst", "restructuredtext")
|
app.add_source_suffix(".rst", "restructuredtext")
|
||||||
|
app.add_source_suffix(".md", "markdown")
|
||||||
|
app.add_source_parser(CustomCommonMarkParser)
|
||||||
|
|
||||||
# RecommonMark Settings ------------------------------------------------------------
|
# RecommonMark Settings ------------------------------------------------------------
|
||||||
# Enable the evaluation of rst directive in .md files
|
# Enable the evaluation of rst directive in .md files
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,11 @@ show_missing = true
|
||||||
skip_covered = true
|
skip_covered = true
|
||||||
exclude_lines = ["if __name__ == .__main__.:", "def __str__", "def __repr__", "pragma: no cover"]
|
exclude_lines = ["if __name__ == .__main__.:", "def __str__", "def __repr__", "pragma: no cover"]
|
||||||
|
|
||||||
|
[tool.coverage.xml]
|
||||||
|
output = "./dist/coverage.xml"
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
line_length = 88
|
profile = "black"
|
||||||
force_grid_wrap = "0"
|
color_output = true
|
||||||
multi_line_output = "3"
|
lines_after_imports = 2
|
||||||
use_parentheses = true
|
|
||||||
combine_as_imports = true
|
combine_as_imports = true
|
||||||
known_first_party = ["v8_server"]
|
|
||||||
known_third_party = ["pytest, recommonmark"]
|
|
||||||
include_trailing_comma = true
|
|
||||||
lines_after_imports = "2"
|
|
||||||
|
|
|
||||||
15
setup.cfg
Normal file
15
setup.cfg
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[aliases]
|
||||||
|
test=pytest
|
||||||
|
|
||||||
|
[bdist_wheel]
|
||||||
|
universal = 1
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
ignore = E203, W503
|
||||||
|
max-line-length = 88
|
||||||
|
inline-quotes = double
|
||||||
|
|
||||||
|
[mypy]
|
||||||
|
warn_unused_ignores = true
|
||||||
|
ignore_missing_imports = true
|
||||||
|
plugins = sqlmypy
|
||||||
17
setup.py
17
setup.py
|
|
@ -5,18 +5,25 @@ from setuptools import find_packages, setup
|
||||||
|
|
||||||
|
|
||||||
TEST_DEPS = ["coverage[toml]", "pytest", "pytest-cov"]
|
TEST_DEPS = ["coverage[toml]", "pytest", "pytest-cov"]
|
||||||
DOCS_DEPS = ["sphinx", "sphinx-rtd-theme", "sphinx-autoapi", "recommonmark"]
|
DOCS_DEPS = ["recommonmark", "sphinx", "sphinx-autoapi", "sphinx-rtd-theme"]
|
||||||
CHECK_DEPS = ["isort", "flake8", "flake8-quotes", "pep8-naming", "mypy", "black"]
|
CHECK_DEPS = [
|
||||||
|
"black",
|
||||||
|
"flake8",
|
||||||
|
"flake8-quotes",
|
||||||
|
"isort[colors]",
|
||||||
|
"mypy",
|
||||||
|
"pep8-naming",
|
||||||
|
]
|
||||||
REQUIREMENTS = [
|
REQUIREMENTS = [
|
||||||
"flask",
|
"flask",
|
||||||
"flask_sqlalchemy",
|
"flask_sqlalchemy",
|
||||||
"watchdog",
|
"kbinxml",
|
||||||
"pyopenssl",
|
|
||||||
"lxml",
|
"lxml",
|
||||||
"pycryptodome",
|
"pycryptodome",
|
||||||
"kbinxml",
|
"pyopenssl",
|
||||||
"sqlalchemy",
|
"sqlalchemy",
|
||||||
"sqlalchemy-stubs",
|
"sqlalchemy-stubs",
|
||||||
|
"watchdog",
|
||||||
]
|
]
|
||||||
|
|
||||||
EXTRAS = {
|
EXTRAS = {
|
||||||
|
|
|
||||||
13
tox.ini
13
tox.ini
|
|
@ -12,19 +12,20 @@ setenv =
|
||||||
PYTHONPATH = {toxinidir}
|
PYTHONPATH = {toxinidir}
|
||||||
COVERAGE_FILE=.coverage.{envname}
|
COVERAGE_FILE=.coverage.{envname}
|
||||||
commands =
|
commands =
|
||||||
py.test --cov=v8_server --verbose --tb=long {posargs}
|
py.test --cov=v8_server --verbose --tb=long --durations=5 {posargs}
|
||||||
|
|
||||||
[testenv:coverage]
|
[testenv:coverage]
|
||||||
basepython = python3.8
|
basepython = python3
|
||||||
deps = coverage[toml]
|
deps = coverage[toml]
|
||||||
skip_install = True
|
skip_install = True
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
commands =
|
commands =
|
||||||
/usr/bin/env bash -c "{envpython} -m coverage combine .coverage.*"
|
/usr/bin/env bash -c "{envpython} -m coverage combine .coverage.*"
|
||||||
coverage report
|
coverage report
|
||||||
|
coverage xml
|
||||||
|
|
||||||
[testenv:check]
|
[testenv:check]
|
||||||
basepython = python3.8
|
basepython = python3
|
||||||
extras = check
|
extras = check
|
||||||
commands =
|
commands =
|
||||||
isort v8_server tests setup.py docs/conf.py --check-only --diff
|
isort v8_server tests setup.py docs/conf.py --check-only --diff
|
||||||
|
|
@ -33,10 +34,10 @@ commands =
|
||||||
mypy v8_server setup.py docs/conf.py
|
mypy v8_server setup.py docs/conf.py
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
basepython = python3.8
|
basepython = python3
|
||||||
extras = docs
|
extras = docs
|
||||||
commands = sphinx-build {posargs:-E} -b html docs dist/docs
|
commands = sphinx-build {posargs:-E} -b html docs dist/docs
|
||||||
|
|
||||||
[travis]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
3.8: check, py38, coverage, docs
|
3.8: py38
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user