Skip to content

Commit

Permalink
Remove package version wildcard ranges (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthagen authored Jun 26, 2022
1 parent 783c719 commit 334c054
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 103 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,36 @@ To deactivate the environment:
(fact) $ exit
```

To upgrade all dependencies to their latest versions:
### Update Dependencies

To upgrade all dependencies in `poetry.lock` to their latest semantic version compatible releases:

```bash
$ poetry update
```

(Applications only) To upgrade all dependencies, other than those pinned to exact versions, in
both `pyproject.toml` and `poetry.lock` to their latest versions (regardless of semantic version)
using [`poetryup`](https:/MousaZeidBaker/poetryup):

```bash
(fact) $ nox -s update_latest
```

This is useful for _applications_ as an alternative to using wildcard versions (`"*"`) for allowing
the developer to avoid manually checking for new major release versions for all top level
dependencies. Putting tight version constraints in `pyproject.toml` can greatly reduce the time
for Poetry to resolve lockfile changes during updates. _Libraries_ should generally avoid pinning
to the latest versions in `project.toml` to allow users of their library the greatest flexibility
in selecting the final dependencies for their applications.

To upgrade only dev dependencies to their latest versions (which is a more appropriate operation
for libraries):

```bash
(fact) $ nox -s update_latest -- --group dev
```

## Packaging

This project is designed as a Python package, meaning that it can be bundled up and redistributed
Expand Down
5 changes: 5 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
nox.options.sessions = ["fmt_check", "lint", "type_check", "test", "docs"]


@session(venv_backend="none")
def update_latest(s: Session) -> None:
s.run("poetryup", "--latest", "--skip-exact", *s.posargs)


@session(python=["3.8", "3.9", "3.10"])
def test(s: Session) -> None:
s.install(".", "pytest", "pytest-cov")
Expand Down
Loading

0 comments on commit 334c054

Please sign in to comment.