Skip to main content

Overarching library for Michiel Cottaar's projects

Project description

The personal utilities and libraries from Michiel Cottaar.

This code contains many different packages which can either be installed separately using pip install mcot.<package> or as one whole pip install mcot.

Command line scripts

Command line scripts are all available through a single executable: mcot . This executable will be installed irrespective of the package you install (it is part of mcot.utils, which is required by all other packages). You can run a specific script using:

mcot $SCRIPTNAME

Many scripts are grouped together, in which case they can be called as:

mcot $GROUP $SCRIPTNAME

To list the installed scripts just type:

mcot

Developer’s notes

All packages are managed as a single monorepo available at https://git.fmrib.ox.ac.uk/ndcn0236/mcot. Testing and packaging is handled through the pants build system https://www.pantsbuild.org/. First make sure to be in the top-level directory and then run the following to test:

./pants test ::

or to build the packages:

./pants package ::

To bump the version number of a package run:

./bump_project.sh <package> <part>

where <part> is one of “major”, “minor”, or “patch”. This will bump the version of both the package and the mcot complete package, which can then be uploaded using twine.

Adding a new package

  1. Create a new directory in “src/mcot”

  2. Add a README.rst and VERSION file with a description and the version number.

  3. Use mcot.utils.build.load_info in __init__.py to import the README and version number

    from mcot.utils.build import load_info
    __doc__, __version__ = load_info(__name__)
    del load_info
  4. Copy an existing .bumpversion.cfg from another directory and update the current version number

  5. Copy a BUILD script from another package (e.g., mcot.surface) and adjust the contents accordingly

  6. Copy BUILD script to test directory from test directory of another project (e.g., “src/mcot/surface/tests”)

  7. Add package requirements to “requirements.txt”

  8. Add the package to documentation in doc/index.rst

  9. Run the tests for this package

    ./pants test src/mcot/<package name>/tests/:
  10. Test the package build:

    ./pants package src/mcot/<package name>:
  11. Build the documentation

    python doc/publish.py

Once the package is ready to be uploaded to pypi: add the package to the BUILD script in the top-level directory and to the upload.sh script

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcot-0.7.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

mcot-0.7.0-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page