diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4212522..2720c6f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: #- id: check-symlinks - id: debug-statements #- id: requirements-txt-fixer - - id: check-executables-have-shebangs + #- id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - id: fix-encoding-pragma args: ['--remove'] diff --git a/README.rst b/README.rst index 5f1a148..b8362ae 100644 --- a/README.rst +++ b/README.rst @@ -14,9 +14,10 @@ per `setuptools documentation`_. To use this template, replace the example project name with your own: * change the project name at the top of ``pyproject.toml`` +* change the project name in ``docs/source/conf.py`` *and* ``docs/source/index.rst`` +* change the author details in ``pyproject.toml`` *and* ``docs/source/conf.py`` * change the package directory name under the ``src`` folder * change the github URL paths in ``pyproject.toml`` -* change the project name in ``docs/source/conf.py`` .. _setuptools documentation: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html @@ -69,8 +70,8 @@ project URL below (using your new project name) and add the following new labels Github best practices --------------------- -Finally, best practices for public repositories includes following extra -features: +Finally, best practices for public repositories should include the following +extra features: * under Advanced Security enable Code Scanning, Dependabot, Private Vulnerability Reporting, and (default) Codeql config @@ -157,7 +158,8 @@ types and line numbers. Note you must fix any fatal errors for the commit to succeed; some errors should be fixed automatically (use ``git status`` and ``git diff`` to review any changes). -See the following sections for more information on gitchangelog and pre-commit. +See the following sections in the built docs for more information on +gitchangelog and pre-commit. You will need to install pre-commit before contributing any changes; installing it using your system's package manager is recommended, diff --git a/docs/source/README.rst b/docs/source/README.rst new file mode 120000 index 0000000..c768ff7 --- /dev/null +++ b/docs/source/README.rst @@ -0,0 +1 @@ +../../README.rst \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index c347547..47a877d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,16 +12,16 @@ # -- Project information ----------------------------------------------------- -proj_name = 'ds2mermaid' +proj_name = 'simple' # The full version, including alpha/beta/rc tags with setuptols-scm # workaround for extra-long dirty version string release = version(proj_name).split("+")[0] -# The short X.Y version. -version = '.'.join(release.split('.')[:2]) +# Use dev version instead of short X.Y version. +version = release project = proj_name -author = 'Goleta Star, LLC' -copyright = '2022 - ' + str(datetime.now().year) + f' {author}' +author = 'Tracy Developer' +copyright = str(datetime.now().year) + f' {author}' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -48,22 +48,11 @@ 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', - 'recommonmark', + 'myst_parser', ] -# autoapi -#autoapi_dirs = ['../../src'] - -# API docs -# apidoc_modules = [ - # { - # "path": f"../../src/{proj_name}", - # "destination": "api/", - # }, -# ] - # sphinxcontrib.apidoc -apidoc_module_dir = '../../src' +apidoc_module_dir = f'../../src/{project}' apidoc_output_dir = 'api' apidoc_excluded_paths = ['scripts', 'tests'] apidoc_module_first = True @@ -76,7 +65,10 @@ # The suffix(es) of source filenames. # You can specify multiple suffix as a list of strings: # -source_suffix = ['.rst', '.md'] +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} # The master toctree document. master_doc = 'index' @@ -94,19 +86,19 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'data'] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'manni' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True - # -- 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' -html_theme = 'classic' # still has a version +html_theme = 'sphinx_rtd_theme' +# setup in https://sphinx-nefertiti.readthedocs.io/latest/quick-start.html +#html_theme = 'sphinx_nefertiti' html_sidebars = { '**': [ @@ -135,7 +127,7 @@ # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. -htmlhelp_basename = 'ds2mermaiddoc' +htmlhelp_basename = 'simpledoc' # -- Options for LaTeX output --------------------------------------------- @@ -162,7 +154,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ds2mermaid.tex', 'ds2mermaid Documentation', + (master_doc, 'simple.tex', 'simple Documentation', [author], 'manual'), ] @@ -172,7 +164,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'ds2mermaid', 'ds2mermaid Documentation', + (master_doc, 'simple', 'simple Documentation', [author], 1) ] @@ -183,7 +175,7 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'ds2mermaid', 'ds2mermaid Documentation', - [author], 'ds2mermaid', description, + (master_doc, 'simple', 'simple Documentation', + [author], 'simple', description, 'Miscellaneous'), ] diff --git a/docs/source/index.rst b/docs/source/index.rst index 54cf4d4..7da97bf 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,4 +1,4 @@ -Foobar API and SW Docs +Simple API and SW Docs ====================== .. git_commit_detail:: @@ -10,10 +10,10 @@ Foobar API and SW Docs :no_github_link: .. toctree:: - :maxdepth: 3 + :maxdepth: 1 :caption: Contents: - readme_include + README api/modules dev/generate-changelog dev/pre-commit-config diff --git a/docs/source/readme_include.rst b/docs/source/readme_include.rst deleted file mode 100644 index 4760b41..0000000 --- a/docs/source/readme_include.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. include:: ../../README.rst - :end-before: inclusion-marker-1 - - -.. include:: ../../README.rst - :start-after: inclusion-marker-2 diff --git a/pyproject.toml b/pyproject.toml index d0f9d70..b0e0aa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,15 +6,15 @@ requires = [ build-backend = "setuptools.build_meta" [project] -name = "ds2mermaid" -description = "A mermaid diagram generator for doorstop requirements" +name = "simple" +description = "A simple project template using setuptools and setuptools-scm" dynamic = ["version"] readme = "README.rst" license = "MIT" authors = [ - {name = "Stephen Arnold"}, - {email = "stephen.arnold42@gmail.com"}, + {name = "Tracy Developer"}, + {email = "developer@some.domain"}, ] classifiers = [ @@ -34,7 +34,6 @@ classifiers = [ dependencies = [ 'importlib-resources; python_version < "3.10"', "munch[yaml]", - "platformdirs", ] requires-python = ">=3.9" @@ -55,8 +54,10 @@ doc = [ "sphinx", "sphinxcontrib.apidoc", "sphinx_git", - "recommonmark", - "sphinx_rtd_theme<3.0", + "myst-parser", + "sphinxcontrib.mermaid", + "sphinx_rtd_theme<3.0", # for the version display + "sphinx-nefertiti", ] test = [ "pytest", @@ -64,10 +65,10 @@ test = [ ] [project.urls] -Homepage = "https://github.com/sarnold/doorstop-to-mermaid" -Repository = "https://github.com/sarnold/doorstop-to-mermaid.git" -Issues = "https://github.com/sarnold/doorstop-to-mermaid/issues" -Changelog = "https://github.com/sarnold/doorstop-to-mermaid/blob/main/CHANGELOG.rst" +Homepage = "https://github.com/sarnold/simple-python-project" +Repository = "https://github.com/sarnold/simple-python-project.git" +Issues = "https://github.com/sarnold/simple-python-project/issues" +Changelog = "https://github.com/sarnold/simple-python-project/blob/main/CHANGELOG.rst" [tool.setuptools] package-dir = {"" = "src"} diff --git a/requirements.txt b/requirements.txt index e33d2d1..2785064 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ importlib-resources; python_version < "3.10" munch[yaml] -platformdirs diff --git a/src/ds2mermaid/__init__.py b/src/simple/__init__.py similarity index 80% rename from src/ds2mermaid/__init__.py rename to src/simple/__init__.py index 67fe52e..1cebc65 100644 --- a/src/ds2mermaid/__init__.py +++ b/src/simple/__init__.py @@ -4,7 +4,7 @@ from importlib.metadata import version -__version__ = version('ds2mermaid') +__version__ = version('simple') __all__ = [ "__version__", diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 8e6d4c3..c44da21 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,10 +1,9 @@ from pathlib import Path +import pytest from munch import Munch -from ds2mermaid import version - -import pytest +from simple import version def test_nothing(capfd): diff --git a/tox.ini b/tox.ini index 11838ba..0aad93e 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ deps = [reqs] deps = - doorstop @ git+https://github.com/VCTLabs/doorstop.git@linux-simple + doorstop [testenv] description = @@ -66,7 +66,7 @@ deps = -e .[test,cov] commands = - python -m pytest -v tests/ --capture={posargs:"fd"} --cov=ds2mermaid --cov-branch --cov-report term-missing + python -m pytest -v tests/ --capture={posargs:"fd"} --cov=simple --cov-branch --cov-report term-missing [testenv:coverage] description = @@ -157,7 +157,7 @@ deps = flake8 commands = - flake8 src/ scripts/ + flake8 src/ [testenv:build] skip_install = true @@ -195,8 +195,8 @@ deps = pip>=23.1 commands = - python -m pip install ds2mermaid --pre --force-reinstall --prefer-binary -f dist/ - python -m pip show -f ds2mermaid + python -m pip install simple --pre --force-reinstall --prefer-binary -f dist/ + python -m pip show -f simple [testenv:{docs,ldocs,cdocs}] # these tox env cmds share a virtual env using the following plugin @@ -238,7 +238,7 @@ deps = munch-stubs @ git+https://github.com/VCTLabs/munch-stubs.git@main commands = - python -m mypy --follow-imports=normal --install-types --non-interactive src/ scripts/ + python -m mypy --follow-imports=normal --install-types --non-interactive src/ [testenv:reuse] skip_install = true @@ -279,7 +279,7 @@ deps = bandit[toml] commands = - bandit -c pyproject.toml -r src scripts + bandit -c pyproject.toml -r src [testenv:changes] skip_install = true @@ -304,22 +304,6 @@ deps = commands = bash -c 'gitchangelog {posargs} > CHANGELOG.rst' -[testenv:md] -skip_install = true -passenv = - DEBUG - PYTHON - CI - OS - PYTHONIOENCODING - PIP_DOWNLOAD_CACHE - -deps = - {[base]deps} - -commands = - python scripts/process_md_urls.py {posargs} - [testenv:clean] skip_install = true allowlist_externals =