diff --git a/.gitignore b/.gitignore index 21ecbd9..edf3810 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +Pipfile.lock *.md *.MD *.XML diff --git a/Makefile b/Makefile index ff64e2d..6480f23 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ #!/usr/bin/env make - # # Makefile # -# Copyright (C) 2019 Franco Masotti +# Copyright (C) 2019-2020 Franco Masotti # # This file is part of fattura-elettronica-reader. # @@ -27,29 +26,37 @@ githook: git config core.hooksPath .githooks pep: - yapf --style '{based_on_style: pep8; indent_width: 4}' -i fattura_pa_reader/*.py tests/*.py - flake8 fattura_pa_reader/*.py --ignore=F401,E501 tests/*.py + pipenv run yapf --style '{based_on_style: pep8; indent_width: 4}' -i fattura_pa_reader/*.py tests/*.py + pipenv run flake8 fattura_pa_reader/*.py --ignore=F401,E501 tests/*.py doc: - $(MAKE) -C docs html + pipenv run $(MAKE) -C docs html install: pip install . -test: - python setup.py test - uninstall: pip uninstall fattura_elettronica_reader +install-dev: + pipenv install + +uninstall-dev: + pipenv --rm + +test: + pipenv run python setup.py test + dist: - python setup.py sdist - python setup.py bdist_wheel + pipenv run python setup.py sdist + pipenv run python setup.py bdist_wheel + pipenv run pipenv run twine check dist/* upload: - twine upload dist/* + pipenv run twine upload dist/* clean: rm -rf build dist *.egg-info + pipenv run $(MAKE) -C docs clean -.PHONY: default pep doc install test uninstall dist upload clean +.PHONY: default pep doc install install-dev test uninstall uninstall-dev dist upload clean diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..4a36c38 --- /dev/null +++ b/Pipfile @@ -0,0 +1,22 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] + +[packages] +requests = "==2.24.0" +lxml = "==4.5.1" +flake8 = "==3.8.3" +flake8-docstrings = "==1.5.0" +yapf = "==0.30.0" +sphinx-rtd-theme = "==0.5.0" +twine = "==3.2.0" +atomicwrites = "==1.4.0" +filetype = "==1.0.7" +appdirs = "==1.4.4" +Sphinx = "==3.1.1" + +[requires] +python_version = "3.8" diff --git a/docs/conf.py b/docs/conf.py index cfdb4e5..7a3fd2f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ sys.path.insert(0, os.path.abspath('..')) # -- Project information ----------------------------------------------------- project = 'fattura-elettronica-reader' -copyright = '2019, Franco Masotti' +copyright = '2019-2020, Franco Masotti' author = 'Franco Masotti' # The short X.Y version @@ -41,7 +41,6 @@ release = '0.1.0' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.coverage', - 'sphinx.ext.imgmath', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', ] @@ -79,7 +78,7 @@ pygments_style = None # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +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 @@ -183,3 +182,34 @@ epub_exclude_files = ['search.html'] # -- Extension configuration ------------------------------------------------- + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# This is required for the alabaster theme +# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars +html_sidebars = { + '**': [ + 'about.html', + 'navigation.html', + 'relations.html', # needs 'show_related': True theme option to display + 'searchbox.html', + 'donate.html', + ] +} + +html_theme_options = { + 'canonical_url': '', + 'logo_only': False, + 'display_version': True, + 'prev_next_buttons_location': 'bottom', + 'style_external_links': False, + 'style_nav_header_background': 'light-blue', + # Toc options + 'collapse_navigation': True, + 'sticky_navigation': True, + 'navigation_depth': 6, + 'includehidden': True, + 'titles_only': False +} + diff --git a/fattura_elettronica_reader/api.py b/fattura_elettronica_reader/api.py index cbb9079..902d666 100644 --- a/fattura_elettronica_reader/api.py +++ b/fattura_elettronica_reader/api.py @@ -4,7 +4,7 @@ # Copyright (c) 2018 Enio Carboni - Italy # Copyright (C) 2019 Franco Masotti # -# This file is part of fattura-pa-reader. +# This file is part of fattura-elettronica-reader. # # fattura-elettronica-reader is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e161dae..0000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -requests==2.21 -lxml==4.3 -flake8==3.7 -flake8-docstrings==1.3 -yapf==0.26 -alabaster==0.7.12 -Sphinx==1.8 -twine==1.13 -atomicwrites==1.3 -filetype==1.0 -appdirs==1.4 -setuptools==41.0