ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.PyPI.FirstParty

Description

PyPI first-party ownership by exact project name or separator-delimited prefix. Exact declarations share the routed grammar in Ecluse.Core.Registry.PyPI.Project.

Synopsis

Name prefixes

data PyPIPrefix Source #

A distribution-name prefix in PEP 503 canonical form.

Instances

Instances details
Show PyPIPrefix Source # 
Instance details

Defined in Ecluse.Core.Registry.PyPI.FirstParty

Eq PyPIPrefix Source # 
Instance details

Defined in Ecluse.Core.Registry.PyPI.FirstParty

mkPyPIPrefix :: Text -> Maybe PyPIPrefix Source #

Build a canonical prefix, accepting terminal separators. Empty, separator-only, or non-name text yields Nothing.

underPyPIPrefix :: PyPIPrefix -> PackageName -> Bool Source #

Match at a separator: acme covers acme-tools, excluding acmeco and bare acme.

First-party declarations

data PyPIFirstParty Source #

A distribution or a prefix owned by the deployment.

Constructors

PyPIOwnedName PackageName

A distribution the deployment owns, matched on its PEP 503 canonical name.

PyPIOwnedPrefix PyPIPrefix

A prefix the deployment owns, matched at PEP 503's separator boundary.

projectFirstPartyEntry :: Text -> Either ParseError PyPIFirstParty Source #

Parse an exact projectName or a prefix ending in a separator then *. Refuse acme*, which would otherwise claim names such as acmeco.

pypiFirstPartyName :: NonEmpty PyPIFirstParty -> PackageName -> Bool Source #

Match an exact canonical name or a declared prefix. Deny by default.