Skip to content

Commit

Permalink
Add Initial Functionality (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibo-Joshi authored Sep 29, 2024
1 parent 3e46223 commit b2f601d
Show file tree
Hide file tree
Showing 47 changed files with 2,060 additions and 32 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ jobs:
- name: Test with pytest
run: |
coverage run -m pytest -v --junit-xml=.test_report.xml
coverage run -m pytest -v --junit-xml=.test_junit.xml
- name: Test Summary
id: test_summary
uses: test-summary/[email protected]
if: always() # always run, even if tests fail
with:
paths: |
.test_report.xml
.test_junit.xml
- name: Submit coverage
uses: codecov/codecov-action@v4
Expand All @@ -52,3 +52,10 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.python-version }}
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
if: ${{ !cancelled() }}
with:
files: .test_junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,6 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
.idea/

tmp/
47 changes: 34 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autoupdate_commit_msg: 'Bump `pre-commit` Dependency Versions'
autoupdate_schedule: quarterly
autoupdate_commit_msg: 'Bump `pre-commit` Dependency Versions'
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.5.1'
rev: v0.6.8
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
# Run the linter.
- id: ruff
args:
- --fix
- --unsafe-fixes
# Does not have support for PEP 695 generics yet
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.2
hooks:
- id: mypy
name: mypy
files: ^(?!(tests)).*\.py$
args:
- --install-types
- --enable-incomplete-feature=NewGenericSyntax
additional_dependencies:
- pydantic-settings~=2.3
- shortuuid~=1.0
- sphinx~=8.0
- tomlkit~=0.13
- typer~=0.12
- types-Pygments
- types-PyYAML
# pyright doesn't work well with pre-commit.ci - see
# - https://github.com/RobertCraigie/pyright-python/pull/300
# - https://github.com/RobertCraigie/pyright-python/issues/231
# - repo: https://github.com/RobertCraigie/pyright-python
# rev: v1.1.382.post0
# hooks:
# - id: pyright
# name: pyright
# files: ^(?!(tests)).*\.py$
# additional_dependencies:
# - pydantic-settings~=2.3
# - shortuuid~=1.0
# - tomlkit~=0.13
# - typer~=0.12
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
args:
Expand Down
7 changes: 0 additions & 7 deletions chango/__init__.py

This file was deleted.

5 changes: 3 additions & 2 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
furo~=2024.5
sphinx~=7.3
furo~=2024.8
sphinx~=8.0
sphinx-copybutton~=0.5
sphinx-paramlinks~=0.6
35 changes: 35 additions & 0 deletions docs/source/chango.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,40 @@ chango
======

.. automodule:: chango
:members:
:show-inheritance:

chango.abc
----------

.. automodule:: chango.abc
:members:
:show-inheritance:

chango.concrete
---------------

.. automodule:: chango.concrete
:members:
:show-inheritance:

chango.constants
----------------

.. automodule:: chango.constants
:members:
:show-inheritance:

chango.errors
-------------

.. automodule:: chango.errors
:members:
:show-inheritance:

chango.helpers
--------------

.. automodule:: chango.helpers
:members:
:show-inheritance:
13 changes: 11 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx_copybutton",
"sphinx_paramlinks",
]

html_theme = "furo"

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

nitpicky = True
# nitpicky = True

# autodoc typehints options
always_use_bars_union = True
typehints_document_rtype = True
typehints_defaults = "braces-after"

# paramlinks options
paramlinks_hyperlink_param = "name"
42 changes: 42 additions & 0 deletions logos/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 17 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "chango"
dynamic = ["version"]
description = 'Changelog Governor for your project'
description = 'CHANgelog GOvernor for Your Project'
readme = "README.rst"
requires-python = ">=3.12"
license = "MIT"
Expand All @@ -23,19 +23,27 @@ classifiers = [
"Topic :: Software Development :: Documentation",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = []
dependencies = [
"pydantic-settings~=2.3",
"shortuuid~=1.0",
"tomlkit~=0.13",
"typer~=0.12",
]

[project.urls]
Documentation = "https://chango.readthedocs.io/"
Issues = "https://github.com/Bibo-Joshi/chango/issues"
Source = "https://github.com/Bibo-Joshi/chango"

[project.scripts]
chango = "chango._cli:app"

# HATCH:
[tool.hatch.version]
path = "chango/__about__.py"
path = "src/chango/__about__.py"

[tool.hatch.build]
packages = ["chango"]
packages = ["src/chango"]

# RUFF:
[tool.ruff]
Expand Down Expand Up @@ -87,3 +95,8 @@ exclude_lines = [
"@abstractmethod",
"if TYPE_CHECKING:"
]

# CHANGO
[tool.chango]
sys_path = "."
chango_instance = { name= "chango_instance", module = "myconfig" }
4 changes: 3 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-e .
pre-commit
coverage~=7.5
pytest~=8.3
coverage
build
-r docs/requirements-docs.txt
File renamed without changes.
10 changes: 10 additions & 0 deletions src/chango/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2024-present Hinrich Mahler <[email protected]>
#
# SPDX-License-Identifier: MIT

__all__ = ["ChangeNoteInfo", "Version", "__version__", "abc", "constants", "errors"]

from . import abc, constants, errors
from .__about__ import __version__
from ._changenoteinfo import ChangeNoteInfo
from ._version import Version
Loading

0 comments on commit b2f601d

Please sign in to comment.