Skip to content

Commit

Permalink
Add dev extra to install development PyPI packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Siecje committed Aug 15, 2024
1 parent a5a402d commit dc95095
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip setuptools
python -m pip install coverage pytest
python -m pip install .
- name: Tests
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## [] -
### Added
- `pip install htmd[dev]` to install development dependencies

## [5.0.0] - 2024-02-09
### Added
- `python -m htmd` will now work
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Commands:
```shell
$ git clone https://github.com/Siecje/htmd.git
$ python3 -m venv venv
$ venv/bin/python -m pip install pip setuptools wheel --upgrade
$ venv/bin/python -m pip install -e htmd/
$ venv/bin/python -m pip install pip setuptools --upgrade
$ venv/bin/python -m pip install -e htmd/[dev]
# You can now make changes inside htmd/ without having to re-install
$ mkdir my_site
$ cd my_site
Expand All @@ -79,7 +79,6 @@ $ ../venv/bin/htmd build
### Running mypy

```shell
$ venv/bin/python -m pip install mypy types-Pygments types-beautifulsoup4
$ venv/bin/python -m mypy .
```

Expand All @@ -97,16 +96,14 @@ $ venv/bin/python -m ruff check --exclude typehints
$ git clone https://github.com/Siecje/htmd.git
$ cd htmd
$ python3 -m venv venv
$ venv/bin/python -m pip install pip setuptools wheel --upgrade
$ venv/bin/python -m pip install -e .
$ venv/bin/python -m pip install pytest
$ venv/bin/python -m pip install pip setuptools --upgrade
$ venv/bin/python -m pip install -e .[dev]
$ venv/bin/python -m pytest .
```

#### Running the tests with coverage.py

```shell
$ venv/bin/python -m pip install coverage
$ venv/bin/coverage run --branch -m pytest .
$ venv/bin/coverage html --omit='/private/*'
$ open htmlcov/index.html
Expand Down
14 changes: 12 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]
requires = ["setuptools"]

[project]
authors = [
Expand All @@ -21,7 +21,6 @@ dependencies = [
"htmlmin",
"jsmin",
"Pygments",
"requests",
]
description = "Write Markdown and Jinja2 templates to create a website"
maintainers = [
Expand All @@ -32,6 +31,17 @@ readme = "README.md"
requires-python = ">=3.11"
version = "5.0.0"

[project.optional-dependencies]
dev = [
"coverage",
"mypy",
"pytest",
"requests",
"ruff",
"types-Pygments",
"types-beautifulsoup4",
]

[project.scripts]
htmd = "htmd.cli:cli"

Expand Down
2 changes: 1 addition & 1 deletion release.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rm -r venv
rm -r htmd.egg-info
find . -type d -name "__pycache__" -exec rm -r {} +
python3 -m venv venv
venv/bin/python -m pip install pip setuptools wheel --upgrade
venv/bin/python -m pip install pip setuptools --upgrade
venv/bin/python -m pip install build --upgrade
venv/bin/python -m build
venv/bin/python -m pip install twine
Expand Down

0 comments on commit dc95095

Please sign in to comment.