Skip to content

Commit

Permalink
Implement review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work committed May 13, 2024
1 parent 3fa094a commit 351691b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed

- Sandboxed processes sticking around after CLI is killed with a signal
- Lockfiles with local versions breaking the `requirements.txt` parser
- Lockfiles with local versions breaking the pip parser

## 6.3.0 - 2024-04-18

Expand Down
3 changes: 3 additions & 0 deletions lockfile/src/parsers/pypi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ fn package<'a>(input: &'a str, registry: Option<&str>) -> IResult<&'a str, Packa

// Parse first-party dependencies.
let (input, version) = package_version(input)?;

// Parse local version specifier.
let (input, local_version) = opt(local_version)(input)?;

let version = match (registry, local_version) {
(_, Some(_)) => PackageVersion::Unknown,
(Some(registry), _) => PackageVersion::ThirdParty(ThirdPartyVersion {
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/requirements-locked.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ requests[security,tests]==2.28.1

werkzeug==2.9.2 ; python_version >= "3.7" and python_version < "3.12"

localversion==2.3.4+1.0.99
localversion==2.3.4+1.0.99.local

attr @ file:///tmp/attr

Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/requirements-unlocked.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ FooProject8 > 1.8.*
FooProject9 > 2.0.*, !=2.1
FooProject10==1.2.3 --random-flag
git+https://github.com/matiascodesal/git-for-pip-example.git@v1.0.0#egg=my-git-package
localversion >= 2.3.4+1.0.99.local

0 comments on commit 351691b

Please sign in to comment.