Skip to content

Commit fd998b8

Browse files
authored
Merge pull request #325 from ligangty/release
Release 1.3.4
2 parents c14663d + 99c6fc8 commit fd998b8

File tree

6 files changed

+119
-10
lines changed

6 files changed

+119
-10
lines changed

charon.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%global owner Commonjava
22
%global modulename charon
33

4-
%global charon_version 1.3.3
4+
%global charon_version 1.3.4
55
%global sdist_tar_name %{modulename}-%{charon_version}
66

77
%global python3_pkgversion 3

charon/cmd/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
"""
16-
from click import group
16+
from click import group, version_option, pass_context
1717
from charon.cmd.cmd_upload import upload
1818
from charon.cmd.cmd_delete import delete
1919
from charon.cmd.cmd_index import index
@@ -22,7 +22,9 @@
2222

2323

2424
@group()
25-
def cli():
25+
@version_option()
26+
@pass_context
27+
def cli(ctx):
2628
"""Charon is a tool to synchronize several types of
2729
artifacts repository data to Red Hat Ronda
2830
service (maven.repository.redhat.com).

charon/pkgs/indexing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from jinja2 import Template
2424
import os
2525
import logging
26-
from typing import List, Set, Dict
26+
from typing import List, Dict
2727

2828
from charon.utils.strings import remove_prefix
2929

@@ -48,7 +48,7 @@ def __get_index_template(package_type: str) -> str:
4848

4949
class IndexedHTML(object):
5050
# object for holding index html file data
51-
def __init__(self, title: str, header: str, items: Set[str]):
51+
def __init__(self, title: str, header: str, items: List[str]):
5252
self.title = title
5353
self.header = header
5454
self.items = items
@@ -174,8 +174,8 @@ def __to_html_content(package_type: str, contents: List[str], folder: str) -> st
174174
items = temp_items
175175
else:
176176
items.extend(contents)
177-
items_set = set(__sort_index_items(items))
178-
index = IndexedHTML(title=folder, header=folder, items=items_set)
177+
items_result = list(filter(lambda c: c.strip(), __sort_index_items(set(items))))
178+
index = IndexedHTML(title=folder, header=folder, items=items_result)
179179
return index.generate_index_file_content(package_type)
180180

181181

@@ -303,8 +303,8 @@ def re_index(
303303
real_contents.append(c)
304304
else:
305305
real_contents = contents
306-
logger.debug(real_contents)
307306
index_content = __to_html_content(package_type, real_contents, path)
307+
logger.debug("The re-indexed page content: %s", index_content)
308308
if not dry_run:
309309
index_path = os.path.join(path, "index.html")
310310
if path == "/":

pyproject.toml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = ["setuptools", "setuptools-scm"]
4+
5+
[project]
6+
name = "charon"
7+
version = "1.3.4"
8+
authors = [
9+
{name = "RedHat EXD SPMM"},
10+
]
11+
readme = "README.md"
12+
keywords = ["charon", "mrrc", "maven", "npm", "build", "java"]
13+
license-files = ["LICENSE"]
14+
requires-python = ">=3.9"
15+
classifiers = [
16+
"Development Status :: 1 - Planning",
17+
"Intended Audience :: Developers",
18+
"License :: OSI Approved :: Apache Software License",
19+
"Topic :: Software Development :: Build Tools",
20+
"Topic :: Utilities",
21+
"Programming Language :: Python :: 3 :: Only",
22+
"Programming Language :: Python :: 3.9",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
27+
]
28+
dependencies = [
29+
"Jinja2>=3.1.3",
30+
"boto3>=1.18.35",
31+
"botocore>=1.21.35",
32+
"click>=8.1.3",
33+
"requests>=2.25.0",
34+
"PyYAML>=5.4.1",
35+
"defusedxml>=0.7.1",
36+
"subresource-integrity>=0.2",
37+
"jsonschema>=4.9.1",
38+
"urllib3>=1.25.10",
39+
"semantic-version>=2.10.0"
40+
]
41+
42+
[project.optional-dependencies]
43+
dev = [
44+
"pylint",
45+
"flake8",
46+
"pep8",
47+
"mypy",
48+
"tox",
49+
]
50+
test = [
51+
"flexmock>=0.10.6",
52+
"responses>=0.9.0",
53+
"pytest<=7.1.3",
54+
"pytest-cov",
55+
"pytest-html",
56+
"requests-mock",
57+
"moto>=5.0.16,<6",
58+
"python-gnupg>=0.5.0,<1"
59+
]
60+
61+
[project.scripts]
62+
charon = "charon.cmd:cli"
63+
64+
[tool.setuptools]
65+
packages = ["charon"]
66+
67+
[tool.setuptools_scm]
68+
fallback_version = "1.3.4+dev.fallback"
69+
70+
[tool.setuptools.package-data]
71+
charon = ["schemas/*.json"]
72+
73+
[tool.mypy]
74+
python_version = "3.9"
75+
76+
[tool.coverage.report]
77+
skip_covered = true
78+
show_missing = true
79+
fail_under = 90
80+
exclude_lines = [
81+
"def __repr__",
82+
"if __name__ == .__main__.:",
83+
"if TYPE_CHECKING:",
84+
"return NotImplemented",
85+
]
86+
87+
[tool.pytest.ini_options]
88+
log_cli_level = "DEBUG"
89+
log_format = "%(asctime)s %(levelname)s %(message)s"
90+
log_date_format = "%Y-%m-%d %H:%M:%S"
91+
testpaths = [
92+
"tests",
93+
]
94+
95+
[tool.flake8]
96+
show_source = true
97+
ignore = [
98+
"D100", # missing docstring in public module
99+
"D104", # missing docstring in public package
100+
"D105", # missing docstring in magic method
101+
"W503", # line break before binary operator
102+
"E203", # whitespace before ':'
103+
"E501", # line too long
104+
"E731", # do not assign a lambda expression
105+
]
106+
per-file-ignores = [
107+
"tests/*:D101,D102,D103", # missing docstring in public class, method, function
108+
]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"""
1616
from setuptools import setup, find_packages
1717

18-
version = "1.3.3"
18+
version = "1.3.4"
1919

2020
long_description = """
2121
This charon is a tool to synchronize several types of

tests/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ responses>=0.9.0
33
pytest<=7.1.3
44
pytest-cov
55
pytest-html
6-
flake8
76
requests-mock
87
moto>=5.0.16,<6
98
python-gnupg>=0.5.0,<1

0 commit comments

Comments
 (0)