Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion charon.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%global owner Commonjava
%global modulename charon

%global charon_version 1.3.3
%global charon_version 1.3.4
%global sdist_tar_name %{modulename}-%{charon_version}

%global python3_pkgversion 3
Expand Down
6 changes: 4 additions & 2 deletions charon/cmd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
from click import group
from click import group, version_option, pass_context
from charon.cmd.cmd_upload import upload
from charon.cmd.cmd_delete import delete
from charon.cmd.cmd_index import index
Expand All @@ -22,7 +22,9 @@


@group()
def cli():
@version_option()
@pass_context
def cli(ctx):
"""Charon is a tool to synchronize several types of
artifacts repository data to Red Hat Ronda
service (maven.repository.redhat.com).
Expand Down
10 changes: 5 additions & 5 deletions charon/pkgs/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from jinja2 import Template
import os
import logging
from typing import List, Set, Dict
from typing import List, Dict

from charon.utils.strings import remove_prefix

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

class IndexedHTML(object):
# object for holding index html file data
def __init__(self, title: str, header: str, items: Set[str]):
def __init__(self, title: str, header: str, items: List[str]):
self.title = title
self.header = header
self.items = items
Expand Down Expand Up @@ -174,8 +174,8 @@ def __to_html_content(package_type: str, contents: List[str], folder: str) -> st
items = temp_items
else:
items.extend(contents)
items_set = set(__sort_index_items(items))
index = IndexedHTML(title=folder, header=folder, items=items_set)
items_result = list(filter(lambda c: c.strip(), __sort_index_items(set(items))))
index = IndexedHTML(title=folder, header=folder, items=items_result)
return index.generate_index_file_content(package_type)


Expand Down Expand Up @@ -303,8 +303,8 @@ def re_index(
real_contents.append(c)
else:
real_contents = contents
logger.debug(real_contents)
index_content = __to_html_content(package_type, real_contents, path)
logger.debug("The re-indexed page content: %s", index_content)
if not dry_run:
index_path = os.path.join(path, "index.html")
if path == "/":
Expand Down
108 changes: 108 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "setuptools-scm"]

[project]
name = "charon"
version = "1.3.4"
authors = [
{name = "RedHat EXD SPMM"},
]
readme = "README.md"
keywords = ["charon", "mrrc", "maven", "npm", "build", "java"]
license-files = ["LICENSE"]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development :: Build Tools",
"Topic :: Utilities",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"Jinja2>=3.1.3",
"boto3>=1.18.35",
"botocore>=1.21.35",
"click>=8.1.3",
"requests>=2.25.0",
"PyYAML>=5.4.1",
"defusedxml>=0.7.1",
"subresource-integrity>=0.2",
"jsonschema>=4.9.1",
"urllib3>=1.25.10",
"semantic-version>=2.10.0"
]

[project.optional-dependencies]
dev = [
"pylint",
"flake8",
"pep8",
"mypy",
"tox",
]
test = [
"flexmock>=0.10.6",
"responses>=0.9.0",
"pytest<=7.1.3",
"pytest-cov",
"pytest-html",
"requests-mock",
"moto>=5.0.16,<6",
"python-gnupg>=0.5.0,<1"
]

[project.scripts]
charon = "charon.cmd:cli"

[tool.setuptools]
packages = ["charon"]

[tool.setuptools_scm]
fallback_version = "1.3.4+dev.fallback"

[tool.setuptools.package-data]
charon = ["schemas/*.json"]

[tool.mypy]
python_version = "3.9"

[tool.coverage.report]
skip_covered = true
show_missing = true
fail_under = 90
exclude_lines = [
"def __repr__",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"return NotImplemented",
]

[tool.pytest.ini_options]
log_cli_level = "DEBUG"
log_format = "%(asctime)s %(levelname)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
testpaths = [
"tests",
]

[tool.flake8]
show_source = true
ignore = [
"D100", # missing docstring in public module
"D104", # missing docstring in public package
"D105", # missing docstring in magic method
"W503", # line break before binary operator
"E203", # whitespace before ':'
"E501", # line too long
"E731", # do not assign a lambda expression
]
per-file-ignores = [
"tests/*:D101,D102,D103", # missing docstring in public class, method, function
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
from setuptools import setup, find_packages

version = "1.3.3"
version = "1.3.4"

long_description = """
This charon is a tool to synchronize several types of
Expand Down
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ responses>=0.9.0
pytest<=7.1.3
pytest-cov
pytest-html
flake8
requests-mock
moto>=5.0.16,<6
python-gnupg>=0.5.0,<1