Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,26 @@ The extras/ package adapts PEP 685/503 name-canonicalization from
pypa/packaging (https://github.com/pypa/packaging), specifically
packaging/utils.py's `canonicalize_name`, licensed under the Apache
License, Version 2.0.

The internal/pep508 package's tokenizer adapts the lexer design of
pypa/packaging (https://github.com/pypa/packaging), specifically
packaging/_tokenizer.py's `Tokenizer`, `Token`, `ParserSyntaxError`, and
`DEFAULT_RULES`, licensed under the Apache License, Version 2.0.

The internal/pep508 package's marker-expression parser adapts the
recursive-descent grammar of pypa/packaging
(https://github.com/pypa/packaging), specifically packaging/_parser.py's
marker productions (`_parse_marker` and friends) and `process_env_var`,
licensed under the Apache License, Version 2.0.

The marker/ package's Environment platform mapping (os_name, sys_platform,
platform_system, platform_release, platform_version) adapts the
linux/macos/windows cases of Astral uv's platform-tag logic
(https://github.com/astral-sh/uv), specifically the uv-configuration crate's
`TargetTriple`, dual-licensed under the Apache License, Version 2.0, or the
MIT license.

The marker/ package's Evaluate adapts the marker-evaluation logic of
pypa/packaging (https://github.com/pypa/packaging), specifically
packaging/markers.py's `_eval_op` and its operator/specifier dispatch,
licensed under the Apache License, Version 2.0.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Part of [RFD 0001 — Native Go PyPI Dependency Resolution](https://github.com/r
|---|---|
| [`version/`](https://github.com/rstudio/go-pep440-version) | PEP 440 versions and specifiers |
| `requirement/` | PEP 508 dependency specifiers |
| `marker/` | PEP 508 environment markers |
| `marker/` | PEP 508 environment markers (implemented) |
| `extras/` | PEP 685 extra-name normalization (implemented) |
| `reqtxt/` | pip `requirements.txt` format |
| [`distribution/`](https://github.com/rstudio/python-distribution-parser) | METADATA / wheel parsing |
Expand Down
14 changes: 14 additions & 0 deletions internal/pep508/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

// Package pep508 implements the shared, position-tracking tokenizer used to
// parse PEP 508 environment markers (package marker/) and, eventually, PEP
// 508 dependency-specifier requirement strings (package requirement/).
//
// It is a Go port of pypa/packaging's _tokenizer.py: a Tokenizer holds the
// source string and a byte offset, and exposes a parser-driven API (check,
// expect, read, consume) rather than pre-scanning the whole input into a
// token slice. Callers ask for a specific token kind at the current
// position, which is what lets requirement-only kinds (added in a later
// package) coexist with marker kinds without any global "first rule wins"
// ordering to maintain.
package pep508
Loading