Skip to content

Commit

Permalink
Merge pull request #22 from datarootsio/feature/add-py37-support
Browse files Browse the repository at this point in the history
Feature/add py37 support
  • Loading branch information
murilo-cunha committed Feb 3, 2022
2 parents cd6ebbf + 8379da7 commit 9f58381
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 61 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ exclude =
per-file-ignores =
__init__.py:F401,D104
tests/*:D100,D104
databooks/version.py:D100
max-line-length = 88
ignore = E203,W503 # conflicts with black
10 changes: 7 additions & 3 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: 85...100"
status:
project:
default:
target: 95%
patch:
default:
informational: true

parsers:
gcov:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
id: git-version
with:
release-branch: main
minor-identifier: feature/
major-identifier: breaking/
minor-identifier: /feature//
major-identifier: /breaking//

publish:
runs-on: ubuntu-latest
Expand All @@ -34,11 +34,14 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies and bump version
- name: Install dependencies
run: |
pip install poetry==${{ env.POETRY_VERSION }}
poetry install
- name: Bump package version
run: |
poetry version ${{ needs.get-new-tag.outputs.tag-id }}
echo '__version__ = "${{ needs.get-new-tag.outputs.tag-id }}"' > databooks/version.py
- name: Configure PiPy, version and build
run: |
poetry config pypi-token.pypi ${{ secrets.PIPY_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The key features include:

`databooks` is built on top of:

- Python 3.8+
- Python 3.7+
- [Typer](https://typer.tiangolo.com/)
- [Rich](https://rich.readthedocs.io/en/latest/)
- [Pydantic](https://pydantic-docs.helpmanual.io/)
Expand Down
12 changes: 3 additions & 9 deletions databooks/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Main CLI application."""
from importlib.metadata import metadata
from itertools import compress
from pathlib import Path
from typing import List, Optional
Expand All @@ -19,8 +18,7 @@
from databooks.conflicts import conflicts2nbs, path2conflicts
from databooks.logging import get_logger
from databooks.metadata import clear_all

_DISTRIBUTION_METADATA = metadata(__package__)
from databooks.version import __version__

logger = get_logger(__file__)

Expand All @@ -30,7 +28,7 @@
def _version_callback(show_version: bool) -> None:
"""Return application version."""
if show_version:
echo("databooks version: " + _DISTRIBUTION_METADATA["Version"])
echo("databooks version: " + __version__)
raise Exit()


Expand Down Expand Up @@ -77,11 +75,7 @@ def callback( # noqa: D103
None, "--version", callback=_version_callback, is_eager=True
)
) -> None:
...


# add docs dynamically from `pyproject.toml`
callback.__doc__ = _DISTRIBUTION_METADATA["Summary"]
"""CLI tool to resolve git conflicts and remove metadata in notebooks."""


@app.command(add_help_option=False)
Expand Down
14 changes: 2 additions & 12 deletions databooks/data_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@

from abc import abstractmethod
from collections import UserList
from typing import (
Any,
Dict,
Generic,
Iterable,
List,
Protocol,
TypeVar,
cast,
overload,
runtime_checkable,
)
from typing import Any, Dict, Generic, Iterable, List, TypeVar, cast, overload

from pydantic import BaseModel, Extra, create_model
from typing_extensions import Protocol, runtime_checkable

T = TypeVar("T")

Expand Down
2 changes: 2 additions & 0 deletions databooks/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""Package version information - this file is dynamically overwritten in CI."""
__version__ = "0.0.0-dev"
114 changes: 89 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f58381

Please sign in to comment.