Skip to content

Commit

Permalink
Add instructions on bootstrapping for tox
Browse files Browse the repository at this point in the history
  • Loading branch information
sixlettervariables committed Oct 30, 2024
1 parent 2c0490b commit 1f4a406
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 21 deletions.
18 changes: 18 additions & 0 deletions pysierraecg/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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`.
3 changes: 3 additions & 0 deletions pysierraecg/bootstrap-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are the minimum requirements to bootstrap building this library
pip-tools>=7
tox>=4
65 changes: 44 additions & 21 deletions pysierraecg/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
```

0 comments on commit 1f4a406

Please sign in to comment.