Skip to content

Commit 366e8a4

Browse files
committed
updated README with installation and developer instructions; more prettifying
1 parent 04b1eac commit 366e8a4

File tree

3 files changed

+92
-6
lines changed

3 files changed

+92
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ publish: build ## publish package to PyPI
4646
#= FORMATTING, TESTING, AND CODE QUALITY
4747

4848
.PHONY: cqa
49-
cqa: ## Run code quality assessments.
49+
cqa: ## Run code quality assessments
5050
$(call INFO_MESSAGE, "Checking lock file consistency")
5151
uv lock --locked
5252
$(call INFO_MESSAGE, "Linting and reformatting files")

README.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# python-package
1+
# biocommons.example
22

33
[![Release](https://img.shields.io/github/v/release/biocommons/python-package)](https://img.shields.io/github/v/release/biocommons/python-package)
44
[![Build status](https://img.shields.io/github/actions/workflow/status/biocommons/python-package/main.yml?branch=main)](https://github.com/biocommons/python-package/actions/workflows/main.yml?query=branch%3Amain)
@@ -8,9 +8,88 @@
88

99
Package Description
1010

11+
This is a [biocommons](https://biocommons.org/) project.
12+
1113
- **Github repository**: <https://github.com/biocommons/python-package/>
1214
- **Documentation** <https://biocommons.github.io/python-package/>
1315

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+
1493
## Getting started with your project
1594

1695
### 1. Create a New Repository

sbin/makefile-extract-documentation

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
"""extract doc from a makefile"""
33

44
# ############################################################################
@@ -11,10 +11,17 @@ import fileinput
1111
import re
1212

1313
BOLD = "\033[1m"
14-
UNDERLINE = "\033[4m"
15-
SECTION_COLOR = "\033[93m"
16-
RESET = "\033[0m"
1714
COMMAND_COLOR = "\033[36m"
15+
HEADER_COLOR = "\033[32m"
16+
RESET = "\033[0m"
17+
SECTION_COLOR = "\033[93m"
18+
UNDERLINE = "\033[4m"
19+
20+
print(f"""🌟🌟 {BOLD}{HEADER_COLOR}{UNDERLINE}biocommons conventional make targets{RESET} 🌟🌟
21+
22+
Using these targets promots consistency between local development and ci/cd commands.
23+
24+
usage: make [target ...])""")
1825

1926
for line in fileinput.input(): # noqa: SIM115
2027
if m := re.match(r"#= (.+)", line):

0 commit comments

Comments
 (0)