From 1f4a40657ec7e8d1a42ef18b37454d20a043aa75 Mon Sep 17 00:00:00 2001 From: Christopher Watford Date: Tue, 29 Oct 2024 23:26:30 -0400 Subject: [PATCH] Add instructions on bootstrapping for tox --- pysierraecg/CONTRIBUTING.md | 18 +++++++ pysierraecg/bootstrap-requirements.txt | 3 ++ pysierraecg/docs/index.md | 65 +++++++++++++++++--------- 3 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 pysierraecg/CONTRIBUTING.md create mode 100644 pysierraecg/bootstrap-requirements.txt diff --git a/pysierraecg/CONTRIBUTING.md b/pysierraecg/CONTRIBUTING.md new file mode 100644 index 0000000..f564002 --- /dev/null +++ b/pysierraecg/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing to pysierraecg +All contributions to the project will be considered for inclusion, simply submit a pull request! + +1. [Fork](https://github.com/sixlettervariables/sierra-ecg-tools/fork) the repository ([read more detailed steps](https://help.github.com/articles/fork-a-repo)). +2. [Create a branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository#creating-a-branch) +3. Make and commit your changes +4. Push your changes back to your fork. +5. [Submit a pull request](https://github.com/sixlettervariables/sierra-ecg-tools/compare/) ([read more detailed steps](https://help.github.com/articles/creating-a-pull-request)). + +## Bootstrapping +To bootstrap the environment: + +1. Create a virtual environment and activate it. +1. `pip install -r bootstrap-requirements.txt` +2. `pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml` +4. `pip-compile --output-file=requirements.txt pyproject.toml` + +You can now run `tox`. diff --git a/pysierraecg/bootstrap-requirements.txt b/pysierraecg/bootstrap-requirements.txt new file mode 100644 index 0000000..2eea2b6 --- /dev/null +++ b/pysierraecg/bootstrap-requirements.txt @@ -0,0 +1,3 @@ +# These are the minimum requirements to bootstrap building this library +pip-tools>=7 +tox>=4 diff --git a/pysierraecg/docs/index.md b/pysierraecg/docs/index.md index ae73e26..a704a5c 100644 --- a/pysierraecg/docs/index.md +++ b/pysierraecg/docs/index.md @@ -5,13 +5,33 @@ For more information on how this was built and deployed, as well as other Python best practices, see [`python-blueprint`](https://github.com/johnthagen/python-blueprint). -!!! info +## Installation - This user guide is purely an illustrative example that shows off several features of MkDocs - and included Markdown extensions. +Install the `sierraecg` package using pip: -## Installation +```bash +pip install sierraecg +``` + +## Quick Start + +To use `sierraecg` within your project, import the `read_file` function and execute it like: + +```python +from sierraecg import read_file + +# (1) +f = read_file("path/to/file.xml") +assert f is not None +``` + +1. This assertion will be `True` +!!! tip + + Within PyCharm, use ++tab++ to auto-complete suggested imports while typing. + +## Contributing First, create and activate a Python virtual environment: === "Linux/macOS" @@ -28,29 +48,32 @@ First, create and activate a Python virtual environment: venv\Scripts\activate ``` -Then install the `sierraecg` package: +Next install the bootstrap requirements: -```bash -pip install . -``` - -## Quick Start +=== "Linux/macOS" -To use `sierraecg` within your project, import the `read_file` function and execute it like: + ```bash + pip install -r bootstrap-requirements.txt + ``` -```python -from sierraecg.lib import read_file +=== "Windows" -# (1) -f = read_file("path/to/file.xml") -assert f is not None -``` + ```powershell + pip install -r bootstrap-requirements.txt + ``` -1. This assertion will be `True` +Next create local requirements files: -!!! tip +=== "Linux/macOS" - Within PyCharm, use ++tab++ to auto-complete suggested imports while typing. + ```bash + pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml + pip-compile --output-file=requirements.txt pyproject.toml + ``` -### Expected Results +=== "Windows" + ```powershell + pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml + pip-compile --output-file=requirements.txt pyproject.toml + ```