Skip to content

Latest commit

 

History

History
151 lines (95 loc) · 5.17 KB

README.rst

File metadata and controls

151 lines (95 loc) · 5.17 KB

pysndbxbnjmnp

My Python sandbox project to try and learn some technologies, including

  • Cython
  • cibuildwheel
  • GitHub Actions
  • later maybe: scikit-build

TestPyPI: https://test.pypi.org/project/pysndbxbnjmnp/

Note

  • One cannot do it without a setup.py because of the extra Cython build step, but people might work on this: pypa/setuptools#2220

Resources

Current State

  • Tests are done locally with tox - using the package that got uploaded to TestPyPI
    • install tox with pip(x)
    • install all Python versions using pyenv
    • run tox inside the tests directory to test the project against all specified Python versions.
    • Notes:
      • Check the available python versions: pyenv versions
      • Run tox with refreshed virtual environments: tox -r

Development Environment Set-Up

  • Create a virtualenv named venv from your global Python interpreter.

  • Install packages: cython sphinx, build, pytest, tox, myst-parser

  • Activate the virtualenv.

  • Create a makefile called Makefile in the root directory and add this code:

    build:
        python -m build
    
    clean: uninstall
        -rm -rf pysndbxbnjmnp.egg-info/
        -rm -rf src/pysndbxbnjmnp.egg-info/
        -rm -rf src/pysndbxbnjmnp/__pycache__
        -rm -rf src/pysndbxbnjmnp/pysndbxbnjmnp.cp*
        -rm src/pysndbxbnjmnp/pysndbxbnjmnp.c
        -rm -rf build/
        -rm -rf dist/
        -rm -rf tests/__pycache__
        -rm -rf .pytest_cache
    
    uninstall:
        python -m pip uninstall -y pysndbxbnjmnp
    
    install:
        python -m pip install -e .
    
    test: install
        python -m pytest -v
    
    .PHONY: build clean uninstall install test
  • Now you are ready to run:

    • make test to build, install and test the project
    • make clean to uninstall and delete all compile and test artifacts

Docs

Specification

  • Have documentation in the docs directory written in markdown.
  • Use sphinx for document generation.
  • Have the resulting html hosted on readthedocs.
  • Let sphinx pull the API documentation from the source code.
  • The creation of a release on GitHub should trigger the build and update of a new readthedocs site.

How to get There

  • Run sphinx-quickstart.
  • Add the myst_parser and sphinx.ext.autodoc to the config.py's extensions.
  • Create an index.md and fill it with content.
  • Connect the rtd account with the GitHub account pysndbxbnjmnp is owned by.
  • Import pysndbxbnjmnp into the rtd account.

Notes

Use this docstring style: https://www.sphinx-doc.org/en/master/usage/domains/python.html#info-field-lists

In order to build the documentation pysndbxbnjmnp must be installed into the Python interpreter used.

With the default webhook enabled on Read the Docs, if I got it right:

  • stable: represents the latest documentation from a release, when you tagged it using semantic versioning.
  • latest: represents the latest documentation pushed to GitHub.