Skip to content

Commit

Permalink
Merge pull request #13 from KlausPopp/refactoring-pep8
Browse files Browse the repository at this point in the history
Refactoring pep8
  • Loading branch information
KlausPopp authored Nov 22, 2020
2 parents 0d9cf06 + 261b040 commit 2f5af0c
Show file tree
Hide file tree
Showing 125 changed files with 12,098 additions and 27,271 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PYTHONPATH=./src;${PYTHONPATH}
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
# ignore too long lines
max-line-length = 80
max-complexity = 18
10 changes: 7 additions & 3 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Python application
on: [push]

jobs:
build:
test:

runs-on: ubuntu-latest

Expand All @@ -21,9 +21,13 @@ jobs:
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --show-source --statistics
#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
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Test with python unittest
run: |
export PYTHONPATH="$PWD/src"; echo $PYTHONPATH
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to moddy will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2020-11-22

### Changed
- Complete refactoring of moddy source code to be pep8 compliant.
Files, methods, parameters and classes have been renamed! API is no longer
compatible with moddy 1.x. Models created for moddy 1.x have to be adapted!
See "Porting from Moddy 1 to 2" in the online documenation for details!

### Removed
- Static svg diagram generator


## [1.10.0] - 2019-09-21

### Added
Expand Down
8 changes: 3 additions & 5 deletions InternalNotes.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@


Dist Packaging
==============

Create source distro:

> cd d:\owncloud\documents\Klaus\eclipse\moddy
> cd D:\owncloud\documents\Klaus\vscode\Moddy\Moddy
> python setup.py sdist

test installation first
Expand All @@ -20,11 +18,11 @@ Activate environment

Test installation from just created
> pip uninstall moddy svgwrite
> pip install d:\owncloud\documents\Klaus\eclipse\moddy\dist\moddy-1.7.0.tar.gz
> pip install D:\owncloud\documents\Klaus\vscode\Moddy\Moddy\dist\moddy-1.7.0.tar.gz


Updload to Pypi

> cd d:\owncloud\documents\Klaus\eclipse\moddy
> cd D:\owncloud\documents\Klaus\vscode\Moddy\Moddy
> twine upload dist/*

81 changes: 48 additions & 33 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../src'))
from moddy.version import VERSION

sys.path.insert(0, os.path.abspath("../src"))

from moddy.version import VERSION # noqa: E402

# -- Project information -----------------------------------------------------

project = 'Moddy Discrete Event Simulator'
copyright = '2019, Klaus Popp'
author = 'Klaus Popp'
project = "Moddy Discrete Event Simulator"
copyright = "2020, Klaus Popp"
author = "Klaus Popp"

# The short X.Y version
version = '.'.join(VERSION.split('.')[0:2])
version = ".".join(VERSION.split(".")[0:2])
# The full version, including alpha/beta/rc tags
release = VERSION

Expand All @@ -39,25 +41,25 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.imgmath',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.imgmath",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
]

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -69,7 +71,7 @@
# 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']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
Expand All @@ -80,7 +82,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -91,7 +93,7 @@
# 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']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -103,12 +105,12 @@
#
# html_sidebars = {}

html_logo = 'moddy-logo-200px.png'
html_logo = "moddy-logo-200px.png"

# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'ModdyDiscreteEventSimulatordoc'
htmlhelp_basename = "ModdyDiscreteEventSimulatordoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -117,15 +119,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -135,8 +134,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ModdyDiscreteEventSimulator.tex', 'Moddy Discrete Event Simulator Documentation',
'Klaus Popp', 'manual'),
(
master_doc,
"ModdyDiscreteEventSimulator.tex",
"Moddy Discrete Event Simulator Documentation",
"Klaus Popp",
"manual",
),
]


Expand All @@ -147,8 +151,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'moddydiscreteeventsimulator', 'Moddy Discrete Event Simulator Documentation',
[author], 1)
(
master_doc,
"moddydiscreteeventsimulator",
"Moddy Discrete Event Simulator Documentation",
[author],
1,
)
]


Expand All @@ -158,9 +167,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ModdyDiscreteEventSimulator', 'Moddy Discrete Event Simulator Documentation',
author, 'ModdyDiscreteEventSimulator', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"ModdyDiscreteEventSimulator",
"Moddy Discrete Event Simulator Documentation",
author,
"ModdyDiscreteEventSimulator",
"One line description of project.",
"Miscellaneous",
),
]


Expand All @@ -179,15 +194,15 @@
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}

# -- Options for todo extension ----------------------------------------------

Expand All @@ -201,6 +216,6 @@ def skip(app, what, name, obj, skip, options):
return False
return skip


def setup(app):
app.connect("autodoc-skip-member", skip)

Loading

0 comments on commit 2f5af0c

Please sign in to comment.