Skip to content

Commit 4a18b64

Browse files
committed
use uv to create virtual environment and update README
1 parent 2fd0c0e commit 4a18b64

File tree

3 files changed

+33
-21
lines changed

3 files changed

+33
-21
lines changed

Makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,18 @@ devready:
4040

4141
#=> venv: make a Python 3 virtual environment
4242
${VE_DIR}:
43-
python3 --version
44-
python3 -mvenv $@; \
45-
source $@/bin/activate; \
46-
python3 -m ensurepip --upgrade; \
47-
pip install --upgrade pip setuptools wheel
48-
43+
uv venv $@
44+
4945
#=> develop: install package in develop mode
5046
.PHONY: develop
5147
develop:
52-
pip install -e ".[dev,tests]"
48+
uv pip install -e ".[dev,tests]"
5349
pre-commit install
5450

5551
#=> install: install package
5652
.PHONY: install
5753
install:
58-
pip install "."
54+
uv pip install "."
5955

6056
#=> build: make sdist and wheel
6157
.PHONY: build

README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![codecov](https://codecov.io/gh/biocommons/biocommons.example/graph/badge.svg?token=CCUMQQV5R6)](https://codecov.io/gh/biocommons/biocommons.example)
44

5+
---
6+
57
This repo provides a template for biocommons Python packages. Here's how to use it:
68

79
1. Click the [Use this template](https://github.com/biocommons/example/generate)
@@ -11,28 +13,43 @@ This repo provides a template for biocommons Python packages. Here's how to use
1113
1. Remove this header.
1214
1. Commit and push.
1315

16+
Delete this section in your generated template.
17+
18+
---
19+
1420
## Installation
1521

1622
To install from pypi: ```pip install biocommons.example```
1723

1824
## Developer Setup
1925

20-
Developers must install zsh, which is required by the Makefile. zsh is included by default in MacOS, and is readily available on all modern Linux distributions.
26+
### Prerequisites
2127

22-
Setup like this:
28+
- [GNU make](https://www.gnu.org/software/make/): Current mechanism for consistent invocation of developer tools.
29+
- Mac: [Install brew](https://brew.sh/), then [install make](https://formulae.brew.sh/formula/make)
30+
- Ubuntu: `sudo apt install make`
31+
- [uv](https://docs.astral.sh/uv/): An extremely fast Python package and project manager, written in Rust.
32+
- All platforms: See the [uv installation instructions](https://docs.astral.sh/uv/getting-started/installation/).
33+
- [zsh](https://www.zsh.org/): Shell used by the Makefile
34+
- Mac: included by default
35+
- Ubuntu: `sudo apt install zsh`
36+
37+
### One-time developer setup
38+
39+
Create a Python virtual environment and install dependencies:
2340

2441
make devready
42+
43+
### Development
44+
45+
Activate your environment:
46+
2547
source venv/bin/activate
2648

2749
Code reformatting:
2850

2951
make reformat
3052

31-
Install pre-commit hook:
32-
33-
# included in `make devready`, not necessary for new installations
34-
pre-commit install
35-
3653
Test:
3754

3855
make test # for current environment
@@ -78,6 +95,3 @@ Try it:
7895
* Quality tools: Code linting and reformatting with Ruff
7996
* GitHub Actions for testing and packaging
8097

81-
## ToDo
82-
83-
* Add devcontainer support

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ classifiers = [
1616
"Operating System :: OS Independent",
1717
]
1818
dynamic = ["version"]
19-
dependencies = ["coloredlogs ~= 15.0", "pyyaml ~= 6.0"]
19+
dependencies = [
20+
"coloredlogs ~= 15.0",
21+
"pyyaml ~= 6.0",
22+
]
2023

2124
[project.optional-dependencies]
2225
dev = [
2326
"build ~= 0.8",
2427
"ipython ~= 8.4",
25-
"pre-commit ~= 3.4",
28+
"pre-commit>=3.8.0",
2629
"ruff == 0.4.4",
2730
]
2831
tests = [
2932
"pytest-cov ~= 4.1",
30-
"pytest-optional-tests",
3133
"pytest ~= 7.1",
3234
"vcrpy",
3335
"tox ~= 4.15",

0 commit comments

Comments
 (0)