Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pyproject.toml #415

Merged
merged 65 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
e1990d6
reimplement configparser getboolean function in utils.py
elisalle Jun 30, 2023
3b55a71
also run pypi release on pyproject.toml
elisalle Jun 30, 2023
d718758
add config class for pyproject.toml
elisalle Jul 3, 2023
2737b87
add zest-releaser-config section to setup.cfg config class
elisalle Jul 3, 2023
aba59f6
also add zest-releaser-config section to pypirc class
elisalle Jul 3, 2023
6124957
write class which pulls together zest.releaser settings from all files
elisalle Jul 3, 2023
da80a0e
copy PypiConfig zest-releaser functions to ZestReleaserConfig class
elisalle Jul 3, 2023
ddb4aa1
slightly change zestreleaser config load call
elisalle Jul 3, 2023
35856cb
read raw config to avoid string formatting, and convert version numbe…
elisalle Jul 3, 2023
6ee4c20
remove now-redundant functions from PypiConfig
elisalle Jul 3, 2023
5add439
update zest_releaser_config() in SetupConfig
elisalle Jul 3, 2023
38296da
update zest releaser config dict only if config type is a dict
elisalle Jul 3, 2023
e25b5f1
use dict.update() method instead of |=, to support python 3.7+
elisalle Jul 3, 2023
3fec40f
move function from SetupConfig and PyprojectTomlConfig to ZestRelease…
elisalle Jul 3, 2023
7af64f7
remove setup.cfg loading from PypiConfig class
elisalle Jul 3, 2023
f38a4cf
clean up imports
elisalle Jul 3, 2023
081164c
add pypirc path option to zest release config class for compatibility
elisalle Jul 3, 2023
8048572
update internal function calls to point to zest release config instea…
elisalle Jul 3, 2023
bad5e82
fix incorrect list indexing and import
elisalle Jul 3, 2023
7faee51
update internal function reference
elisalle Jul 3, 2023
5ec5293
fix incorrect default arguments
elisalle Jul 3, 2023
9ecc96e
clean up zest releaser config functions for pypirc and setup config c…
elisalle Jul 4, 2023
1543847
update docstring, change zest_releaser_config() function of Pyproject…
elisalle Jul 4, 2023
94f758c
remove unused pypi_cfg attribute
elisalle Jul 4, 2023
96066e0
remove setup_cfg instances where inapplicable and replace with zest_r…
elisalle Jul 4, 2023
41788f5
use dict.get() instead of try-except with KeyError
elisalle Jul 4, 2023
51b6e97
set interpolation=None in configparser instead of item fetching
elisalle Jul 4, 2023
021c36a
update function references in pypi test
elisalle Jul 4, 2023
bab792f
fix incorrect dict key
elisalle Jul 4, 2023
53b2fd7
add functions to extract package name from setup.cfg and pyproject.toml
elisalle Jul 4, 2023
9e0f538
fetch package name from any file in git.py
elisalle Jul 4, 2023
9527a63
use build instead of setup.py to build the python package
elisalle Jul 4, 2023
6aeeffe
use own runner for project building to properly handle warnings and e…
elisalle Jul 6, 2023
3fe45d3
improve error/warning matching in build subprocess runner
elisalle Jul 6, 2023
ca53bbe
fix incorrect MANIFEST.in in example package for tests
elisalle Jul 6, 2023
0a446ab
move colour reset code to end of red line
elisalle Jul 6, 2023
413f27f
convert colorama reset code to plain text for tests
elisalle Jul 6, 2023
57831c2
further modification of test package MANIFEST.in
elisalle Jul 6, 2023
586d419
change expected output from setuptools logging to build logging
elisalle Jul 6, 2023
3457c90
workaround conflicting pyc files
elisalle Jul 6, 2023
9d92868
update pyproject.toml test to new default answer
elisalle Jul 6, 2023
0e568db
use entrypoints from any config file, not just setup.cfg
elisalle Jul 6, 2023
76317b5
fix bug in config loading from config files
elisalle Jul 6, 2023
d6fae90
run upload distributions on pyproject.toml as well
elisalle Jul 6, 2023
c31b858
print tracebacks in build process to terminal instead of just crashing
elisalle Jul 7, 2023
abb8489
switch to implicit namespacing on test package to avoid deprecation w…
elisalle Jul 7, 2023
8e0c239
fix pyproject.toml release test
elisalle Jul 7, 2023
40e0c5d
remove walrus operator incompatible with py37
elisalle Jul 10, 2023
a5ded05
remove print, log failed build from SystemExit
elisalle Jul 10, 2023
f617ecb
add pyproject.toml settings option to readme
elisalle Jul 10, 2023
f485e7b
update changelog
elisalle Jul 10, 2023
5f53205
add pyproject.toml assumptions to assumptions.rst
elisalle Jul 10, 2023
b437e9d
fix entrypoints support in pyproject.toml
elisalle Jul 10, 2023
e63795b
update developing documentation; setuptools is no longer required in …
elisalle Jul 10, 2023
39e7107
use true/false instead of yes/no as default documented boolean options
elisalle Jul 10, 2023
5dad81c
reference tool.zest-releaser instead of tools.zest-releaser in pyproj…
elisalle Jul 10, 2023
23d190f
name python-file-with-version option for pyproject.toml in docs
elisalle Jul 10, 2023
1c7bb00
Clarify changelog
elisalle Jul 11, 2023
072f46a
Change docstring formatting
elisalle Jul 11, 2023
00589a7
Give a nicer error message
elisalle Jul 11, 2023
85f92e9
Fix incorrect documentation in docstring
elisalle Jul 11, 2023
e623675
move integer keys to be converted to int into a separate list
elisalle Jul 11, 2023
554daf3
add debug log messages for zest-releaser section not found in config
elisalle Jul 11, 2023
9bebc8b
move zest-releaser config extraction for configparser to separate uti…
elisalle Jul 11, 2023
7f20a28
add pyproject.toml documentation to entrypoints section
elisalle Jul 11, 2023
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
16 changes: 9 additions & 7 deletions zest/releaser/baserelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ def __init__(self, vcs=None):
"zest.releaser.tests", "pypirc_old.txt"
)
self.pypiconfig = pypi.PypiConfig(pypirc_old)
self.zest_releaser_config = pypi.ZestReleaserConfig(pypirc_config_filename=pypirc_old)
else:
self.pypiconfig = pypi.PypiConfig()
if self.pypiconfig.no_input():
self.zest_releaser_config = pypi.ZestReleaserConfig()
if self.zest_releaser_config.no_input():
utils.AUTO_RESPONSE = True

@property
def history_format(self):
default = "rst"
config_value = self.pypiconfig.history_format()
config_value = self.zest_releaser_config.history_format()
history_file = self.data.get("history_file") or ""
return utils.history_format(config_value, history_file)

Expand Down Expand Up @@ -124,8 +126,8 @@ def _grab_history(self):
self.data["headings"] = []
self.data["history_last_release"] = ""
self.data["history_insert_line_here"] = 0
default_location = self.pypiconfig.history_file()
fallback_encoding = self.pypiconfig.encoding()
default_location = self.zest_releaser_config.history_file()
fallback_encoding = self.zest_releaser_config.encoding()
history_file = self.vcs.history_file(location=default_location)
self.data["history_file"] = history_file
if not history_file:
Expand Down Expand Up @@ -416,7 +418,7 @@ def _push(self):
push_cmds = self.vcs.push_commands()
if not push_cmds:
return
default_anwer = self.pypiconfig.push_changes()
default_anwer = self.zest_releaser_config.push_changes()
if utils.ask("OK to push commits to the server?", default=default_anwer):
for push_cmd in push_cmds:
output = execute_command(push_cmd)
Expand All @@ -440,8 +442,8 @@ def execute(self):
raise NotImplementedError()

def update_commit_message(self, msg):
prefix_message = self.pypiconfig.prefix_message()
extra_message = self.pypiconfig.extra_message()
prefix_message = self.zest_releaser_config.prefix_message()
extra_message = self.zest_releaser_config.extra_message()
if prefix_message:
msg = "%s %s" % (prefix_message, msg)
if extra_message:
Expand Down
6 changes: 3 additions & 3 deletions zest/releaser/bumpversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def _grab_version(self, initial=False):
feature=feature,
breaking=breaking,
final=final,
less_zeroes=self.pypiconfig.less_zeroes(),
levels=self.pypiconfig.version_levels(),
dev_marker=self.pypiconfig.development_marker(),
less_zeroes=self.zest_releaser_config.less_zeroes(),
levels=self.zest_releaser_config.version_levels(),
dev_marker=self.zest_releaser_config.development_marker(),
)
if final:
minimum_version = utils.suggest_version(original_version, **params)
Expand Down
2 changes: 1 addition & 1 deletion zest/releaser/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def cmd_diff(self):

def cmd_commit(self, message):
parts = ["git", "commit", "-a", "-m", message]
if not self.pypi_cfg.run_pre_commit():
if not self.zest_releaser_config.run_pre_commit():
parts.append("-n")
return parts

Expand Down
8 changes: 4 additions & 4 deletions zest/releaser/postrelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, vcs=None, breaking=False, feature=False, final=False):
feature=feature,
final=final,
dev_version_template=DEV_VERSION_TEMPLATE,
development_marker=self.pypiconfig.development_marker(),
development_marker=self.zest_releaser_config.development_marker(),
history_header=HISTORY_HEADER,
update_history=True,
)
Expand Down Expand Up @@ -82,9 +82,9 @@ def _ask_for_new_dev_version(self):
breaking=self.data["breaking"],
feature=self.data["feature"],
final=self.data["final"],
less_zeroes=self.pypiconfig.less_zeroes(),
levels=self.pypiconfig.version_levels(),
dev_marker=self.pypiconfig.development_marker(),
less_zeroes=self.zest_releaser_config.less_zeroes(),
levels=self.zest_releaser_config.version_levels(),
dev_marker=self.zest_releaser_config.development_marker(),
)
suggestion = utils.suggest_version(current, **params)
print("Current version is %s" % current)
Expand Down
2 changes: 1 addition & 1 deletion zest/releaser/prerelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Prereleaser(baserelease.Basereleaser):
def __init__(self, vcs=None):
baserelease.Basereleaser.__init__(self, vcs=vcs)
# Prepare some defaults for potential overriding.
date_format = self.pypiconfig.date_format()
date_format = self.zest_releaser_config.date_format()
self.data.update(
dict(
commit_msg=PRERELEASE_COMMIT_MSG,
Expand Down
Loading