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

v2.0.1. release candidate #17

Merged
merged 19 commits into from
Feb 2, 2024
Merged
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: cfitall tests

on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pipenv
pipenv install -d
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run unit tests
run: |
pipenv run python -m unittest -v
- name: Check types with mypy
run: |
pipenv run mypy -p cfitall
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGES
=======

* add github workflow

v2.0.0
------

* fix doc issues for 2.0 (#12)
* fix issues w/ python 3.8 typing
* rtd
* rtd
* rtd
Expand Down
18 changes: 10 additions & 8 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ verify_ssl = true
pbr = "*"
cfitall = {editable = true,path = "."}
ipython = "*"
twine = "*"
coverage = "*"
mypy = "*"
sphinx = "*"
sphinx-autodoc-typehints = "*"
sphinx-rtd-theme = "*"
twine = "<5"
coverage = "<7"
mypy = "<2"
sphinx = ">=4.5"
sphinx-autodoc-typehints = "<2"
sphinx-rtd-theme = "<2"
tomli = { version = "*", markers = "python_version < '3.11'" }
types-pyyaml = "<7"


[packages]
pyyaml = "*"
types-pyyaml = "*"
pyyaml = "<7"
930 changes: 572 additions & 358 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cfitall/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ConfigurationRegistry(object):
def __init__(
self,
name: str,
defaults: Dict = None,
defaults: Optional[Dict] = None,
providers: Optional[List[ConfigProviderBase]] = None,
) -> None:
"""
Expand Down
8 changes: 5 additions & 3 deletions cfitall/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
"""

from collections.abc import Mapping
from typing import Dict
from typing import Dict, Optional

from cfitall import ConfigValueType


def add_keys(destdict: dict, srclist: list, value: ConfigValueType = None) -> dict:
def add_keys(
destdict: dict, srclist: list, value: Optional[ConfigValueType] = None
) -> dict:
"""
Nests keys from srclist into destdict, with optional value set on the final key.

Expand All @@ -34,7 +36,7 @@ def add_keys(destdict: dict, srclist: list, value: ConfigValueType = None) -> di


def expand_flattened_path(
flattened_path: str, value: ConfigValueType = None, separator: str = "."
flattened_path: str, value: Optional[ConfigValueType] = None, separator: str = "."
) -> dict:
"""
Expands a dotted path into a nested dict; if value is set, the
Expand Down
8 changes: 0 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,9 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

import sphinx_rtd_theme

# here = os.path.dirname(os.path.abspath(__file__))
# cfitall_path = os.path.join(here, "..", "cfitall")
# sys.path.insert(0, cfitall_path)
print(sys.path)


# -- Project information -----------------------------------------------------

project = "cfitall"
Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ classifier =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12

[options]
packages = find:
install_requires =
PyYAML <=6
PyYAML <= 7

[files]
data_files =
tests = tests/*
tests = tests/*
Loading