Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/sphinx-5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperlees committed Jul 31, 2022
2 parents 483fc57 + b0779c7 commit 127b2a9
Show file tree
Hide file tree
Showing 27 changed files with 733 additions and 203 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 6.0.0

## New Features

- Add PEP691 simple index support `PR #1154`

# 5.3.0 (2022-07-29)

## New Features
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ project_urls =
Source Code = https://github.com/pypa/bandersnatch
Change Log = https://github.com/pypa/bandersnatch/blob/master/CHANGES.md
url = https://github.com/pypa/bandersnatch/
version = 5.3.0
version = 6.0.0.dev0

[options]
install_requires =
Expand Down
6 changes: 3 additions & 3 deletions src/bandersnatch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def version_str(self) -> str:


__version_info__ = _VersionInfo(
major=5,
minor=3,
major=6,
minor=0,
micro=0,
releaselevel="",
releaselevel="dev0",
serial=0, # Not currently in use with Bandersnatch versioning
)
__version__ = __version_info__.version_str
11 changes: 10 additions & 1 deletion src/bandersnatch/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from pathlib import Path
from typing import Any, Dict, List, NamedTuple, Optional, Type

from .simple import SimpleFormat, get_format_value

logger = logging.getLogger("bandersnatch")


Expand All @@ -22,6 +24,7 @@ class SetConfigValues(NamedTuple):
compare_method: str
download_mirror: str
download_mirror_no_fallback: bool
simple_format: SimpleFormat


class Singleton(type): # pragma: no cover
Expand Down Expand Up @@ -75,7 +78,6 @@ def load_configuration(self) -> None:
self.config.read(config_file)


# 11-15, 84-89, 98-99, 117-118, 124-126, 144-149
def validate_config_values( # noqa: C901
config: configparser.ConfigParser,
) -> SetConfigValues:
Expand Down Expand Up @@ -205,6 +207,12 @@ def validate_config_values( # noqa: C901
+ "is not set in config."
)

try:
simple_format = get_format_value(config.get("mirror", "simple-format"))
except configparser.NoOptionError:
logger.debug("Storing all Simple Formats by default ...")
simple_format = SimpleFormat.ALL

return SetConfigValues(
json_save,
root_uri,
Expand All @@ -217,4 +225,5 @@ def validate_config_values( # noqa: C901
compare_method,
download_mirror,
download_mirror_no_fallback,
simple_format,
)
4 changes: 4 additions & 0 deletions src/bandersnatch/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ workers = 3
; Recommended setting: the default of false for full pip/pypi compatibility.
hash-index = false

; Format for simple API to be stored in
; Since PEP691 we have HTML and JSON
simple-format = ALL

; Whether to stop a sync quickly after an error is found or whether to continue
; syncing but not marking the sync as successful. Value should be "true" or
; "false".
Expand Down
Loading

0 comments on commit 127b2a9

Please sign in to comment.