|
1 | | -# python-package |
| 1 | +# biocommons.example |
2 | 2 |
|
3 | 3 | [](https://img.shields.io/github/v/release/biocommons/python-package) |
4 | 4 | [](https://github.com/biocommons/python-package/actions/workflows/main.yml?query=branch%3Amain) |
|
8 | 8 |
|
9 | 9 | Package Description |
10 | 10 |
|
| 11 | +This is a [biocommons](https://biocommons.org/) project. |
| 12 | + |
11 | 13 | - **Github repository**: <https://github.com/biocommons/python-package/> |
12 | 14 | - **Documentation** <https://biocommons.github.io/python-package/> |
13 | 15 |
|
| 16 | +## Python Package Installation |
| 17 | + |
| 18 | +Install from PyPI using one or more of the following: |
| 19 | + |
| 20 | +- `pip install biocommons.example` |
| 21 | +- `uv pip install biocommons.example` |
| 22 | +- Add `biocommons.example` to dependencies in `pyproject.toml` or `requirements.txt` |
| 23 | + |
| 24 | +## Developer Setup |
| 25 | + |
| 26 | +### Install Prerequisites |
| 27 | + |
| 28 | +These tools are required to get started: |
| 29 | + |
| 30 | +- [git](https://git-scm.com/): Version control system |
| 31 | +- [GNU make](https://www.gnu.org/software/make/): Current mechanism for consistent invocation of developer tools. |
| 32 | +- [uv](https://docs.astral.sh/uv/): An extremely fast Python package and project manager, written in Rust. |
| 33 | + |
| 34 | +#### MacOS or Linux Systems |
| 35 | + |
| 36 | +- [Install brew](https://brew.sh/) |
| 37 | +- `brew install git make uv` |
| 38 | + |
| 39 | +#### Linux (Debian-based systems) |
| 40 | + |
| 41 | +You may also install using distribution packages: |
| 42 | + |
| 43 | + sudo apt install git make |
| 44 | + |
| 45 | +Then install uv using the [uv installation instructions](https://docs.astral.sh/uv/getting-started/installation/). |
| 46 | + |
| 47 | +### One-time developer setup |
| 48 | + |
| 49 | +Create a Python virtual environment, install dependencies, install pre-commit hooks, and install an editable package: |
| 50 | + |
| 51 | + make devready |
| 52 | + |
| 53 | +### Development |
| 54 | + |
| 55 | +**N.B.** Developers are strongly encouraged to use `make` to invoke tools to |
| 56 | +ensure consistency with the CI/CD pipelines. Type `make help` to see a list of |
| 57 | +supported targets. |
| 58 | + |
| 59 | +Try it: |
| 60 | + |
| 61 | + $ source venv/bin/activate |
| 62 | + |
| 63 | + $ python3 -m biocommons.example |
| 64 | + Marvin says: |
| 65 | + There's only one life-form as intelligent as me within thirty parsecs... |
| 66 | + |
| 67 | + $ marvin-quote |
| 68 | + Marvin says: |
| 69 | + You think you've got problems? What are you supposed to do if you... |
| 70 | + |
| 71 | + $ ipython |
| 72 | + >>> from biocommons.example import __version__, get_quote_from_marvin |
| 73 | + >>> __version__ |
| 74 | + '0.1.dev8+gd5519a8.d20211123' |
| 75 | + >>> get_quote() |
| 76 | + "The first ten million years were the worst, ... |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
14 | 93 | ## Getting started with your project |
15 | 94 |
|
16 | 95 | ### 1. Create a New Repository |
|
0 commit comments