diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index f56a490..0c3f0d9 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -23,7 +23,7 @@ jobs: - run: pip install mypy - run: mypy org_rw --check-untyped-defs - style-formatting: + formatting: runs-on: ubuntu-latest steps: - name: Check out repository code @@ -33,16 +33,6 @@ jobs: - run: pip install black - run: black --check . - style-sorted-imports: - runs-on: ubuntu-latest - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - run: apt-get update && apt-get install -y python3-pip - - run: pip install -e . - - run: pip install isort - - run: isort --profile black --check . - stability-extra-test: runs-on: ubuntu-latest steps: diff --git a/org_rw/org_rw.py b/org_rw/org_rw.py index 970f641..cefbe5e 100644 --- a/org_rw/org_rw.py +++ b/org_rw/org_rw.py @@ -1,5 +1,6 @@ from __future__ import annotations - +from typing import Dict, Optional, TextIO +from datetime import timedelta import collections import difflib import logging @@ -8,21 +9,12 @@ import re import sys from datetime import date, datetime, timedelta from enum import Enum -from typing import ( - Dict, - Iterator, - List, - Literal, - Optional, - TextIO, - Tuple, - TypedDict, - Union, - cast, -) +from typing import cast, Iterator, List, Literal, Optional, Tuple, TypedDict, Union + +from .types import HeadlineDict from . import dom -from .types import HeadlineDict + DEBUG_DIFF_CONTEXT = 10 diff --git a/org_rw/utils.py b/org_rw/utils.py index 5b8b4e5..405c62b 100644 --- a/org_rw/utils.py +++ b/org_rw/utils.py @@ -6,15 +6,16 @@ from .org_rw import ( Headline, Italic, Line, - ListItem, RawLine, + ListItem, Strike, Text, Underlined, Verbatim, - dump_contents, ) +from .org_rw import dump_contents + def get_hl_raw_contents(doc: Headline) -> str: lines = [] diff --git a/scripts/apply-formatting.sh b/scripts/apply-formatting.sh deleted file mode 100755 index 2f7486b..0000000 --- a/scripts/apply-formatting.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -eu - -cd "`dirname $0`" -cd .. - -set -x - -isort --profile black . -black . diff --git a/tests/test_org.py b/tests/test_org.py index 6a54395..97b8a04 100644 --- a/tests/test_org.py +++ b/tests/test_org.py @@ -2,6 +2,9 @@ import os import unittest from datetime import datetime as DT +from org_rw import MarkerToken, MarkerType, Timestamp, dumps, load, loads, dom +import org_rw + from utils.assertions import ( BOLD, CODE, @@ -16,9 +19,6 @@ from utils.assertions import ( Tokens, ) -import org_rw -from org_rw import MarkerToken, MarkerType, Timestamp, dom, dumps, load, loads - DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/tests/test_timestamp.py b/tests/test_timestamp.py index f7e0eca..7d69d13 100644 --- a/tests/test_timestamp.py +++ b/tests/test_timestamp.py @@ -1,9 +1,7 @@ """Test the Timestamp object.""" -from datetime import date, datetime - import pytest - +from datetime import date, datetime from org_rw import Timestamp