-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from dryan/change-to-uv
Change to uv
- Loading branch information
Showing
10 changed files
with
224 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import argparse | ||
import pathlib | ||
import re | ||
|
||
from packaging.version import Version | ||
from packaging.version import parse | ||
|
||
|
||
def main(): | ||
args_parser = argparse.ArgumentParser() | ||
args_parser.add_argument( | ||
"version_type", | ||
choices=["major", "minor", "patch"], | ||
default="patch", | ||
nargs="?", | ||
) | ||
args_parser.add_argument("--prerelease", action="store_true") | ||
args = args_parser.parse_args() | ||
version_type = args.version_type | ||
prerelease = args.prerelease | ||
pyproject_content = pathlib.Path("pyproject.toml").read_text() | ||
pyproject_version = re.search(r'version = "(.+)"', pyproject_content).group(1) | ||
pyproject_version = parse(pyproject_version) | ||
new_version = Version(str(pyproject_version)) | ||
match version_type: | ||
case "major": | ||
new_version = Version(f'{".".join([str(new_version.major + 1), "0", "0"])}') | ||
case "minor": | ||
new_version = Version( | ||
f'{".".join([str(new_version.major), str(new_version.minor + 1), "0"])}' | ||
) | ||
case "patch": | ||
if pyproject_version.pre and prerelease: | ||
new_version = Version( | ||
f'{".".join([str(new_version.major), str(new_version.minor), str(new_version.micro)])}{new_version.pre[0]}{new_version.pre[1] + 1}' | ||
) | ||
else: | ||
new_version = Version( | ||
f'{".".join([str(new_version.major), str(new_version.minor), str(new_version.micro + 1)])}' | ||
) | ||
if prerelease and not new_version.pre: | ||
new_version = Version( | ||
f"{new_version}{new_version.pre[0] or 'a' if new_version.pre else 'a'}{new_version.pre[1] + 1 if new_version.pre else 1}" | ||
) | ||
|
||
if new_version != pyproject_version: | ||
print(f"Updating version from {pyproject_version} to {new_version}") | ||
pyproject_content = re.sub( | ||
r'version = "(.+)"', | ||
f'version = "{new_version}"', | ||
pyproject_content, | ||
) | ||
pathlib.Path("pyproject.toml").write_text(pyproject_content) | ||
d3ploy_content = pathlib.Path("d3ploy/d3ploy.py").read_text() | ||
d3ploy_content = re.sub( | ||
r'VERSION = "(.+)"', | ||
f'VERSION = "{new_version}"', | ||
d3ploy_content, | ||
) | ||
pathlib.Path("d3ploy/d3ploy.py").write_text(d3ploy_content) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import os | ||
import pathlib | ||
import re | ||
import sys | ||
|
||
|
||
def main(): | ||
d3ploy_content = pathlib.Path("d3ploy/d3ploy.py").read_text() | ||
d3ploy_version = re.search(r'VERSION = "(.+)"', d3ploy_content) | ||
pyproject_content = pathlib.Path("pyproject.toml").read_text() | ||
pyproject_version = re.search(r'version = "(.+)"', pyproject_content) | ||
|
||
if d3ploy_version.group(1) != pyproject_version.group(1): | ||
print( | ||
f"Versions do not match: {d3ploy_version.group(1)} != {pyproject_version.group(1)}", | ||
file=sys.stderr, | ||
) | ||
sys.exit(os.EX_DATAERR) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "d3ploy" | ||
version = "4.4.1" | ||
version = "4.4.2" | ||
description = "Easily deploy to S3 with multiple environment support." | ||
authors = [ | ||
{name = "dryan", email = "[email protected]"}, | ||
|
@@ -31,19 +31,22 @@ repository = "https://github.com/dryan/d3ploy" | |
documentation = "https://github.com/dryan/d3ploy#readme" | ||
|
||
[project.scripts] | ||
d3ploy = "d3ploy.cli" | ||
d3ploy = "d3ploy:cli" | ||
|
||
[tool.ruff.lint.isort] | ||
force-single-line = true | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"black>=24.10.0", | ||
"coverage>=7.6.4", | ||
"flake8>=7.1.1", | ||
"ipython>=8.29.0", | ||
"isort>=5.13.2", | ||
"pytest-cov>=6.0.0", | ||
"ruff>=0.7.3", | ||
"twine>=5.1.1", | ||
] | ||
|
||
[build-system] | ||
build-backend = "hatchling.build" | ||
requires = ["hatchling",] | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = ["tests/test*.py"] | ||
addopts = ["--cov=d3ploy", "--cov-report=term-missing", "--cov-report=html", "--cov-fail-under=100"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.