File tree Expand file tree Collapse file tree 6 files changed +25
-20
lines changed
Expand file tree Collapse file tree 6 files changed +25
-20
lines changed Original file line number Diff line number Diff line change 9494 setup.py
9595
9696 - name : Install dependencies
97- run : python -m pip install -e ".[dev]" -e ".[ docs]"
97+ run : python -m pip install -e ".[dev, docs]"
9898
9999 - name : Run mypy
100100 run : mypy .
Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ Install documentation dependencies with:
2424pip install -e " .[docs]"
2525```
2626
27+ Install runtime dependencies with:
28+
29+ ``` bash
30+ pip install -e .
31+ ```
32+
33+ All dependencies can be installed at once with:
34+
35+ ``` bash
36+ pip install -e " .[dev,docs]"
37+ ```
38+
2739### Running the Tests
2840
2941Run the following command to run the [ Tox] ( https://github.com/tox-dev/tox ) test script which will verify that the tested functionality is still working.
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ build-backend = "setuptools.build_meta"
55
66[project ]
77name = " table2ascii"
8+ version = " 1.1.0"
89authors = [{name = " Jonah Lawrence" , email = " jonah@freshidea.com" }]
9- dynamic = [" version" ]
1010description = " Convert 2D Python lists into Unicode/ASCII tables"
1111readme = " README.md"
1212requires-python = " >=3.7"
@@ -39,6 +39,7 @@ classifiers = [
3939]
4040dependencies = [
4141 " typing-extensions>=3.7.4; python_version<'3.8'" ,
42+ " importlib-metadata<5,>=1; python_version<'3.8'" ,
4243 " wcwidth<1" ,
4344]
4445
Original file line number Diff line number Diff line change 11# /usr/bin/env python
2- import re
3-
42from setuptools import setup
53
6-
7- def version ():
8- version = ""
9- with open ("table2ascii/__init__.py" ) as f :
10- version = re .search (r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]' , f .read (), re .MULTILINE )
11- if not version :
12- raise RuntimeError ("version is not set" )
13- return version .group (1 )
14-
15-
16- setup (name = "table2ascii" , version = version ())
4+ setup ()
Original file line number Diff line number Diff line change 11"""
22table2ascii - Library for converting 2D Python lists to fancy ASCII/Unicode tables
33"""
4+ import sys
5+ from typing import TYPE_CHECKING
46
57from .alignment import Alignment
68from .merge import Merge
79from .preset_style import PresetStyle
810from .table_style import TableStyle
911from .table_to_ascii import table2ascii
1012
11- __version__ = "1.0.4"
13+ if TYPE_CHECKING or sys .version_info >= (3 , 8 ):
14+ from importlib import metadata
15+ else :
16+ import importlib_metadata as metadata
17+
18+ __version__ = metadata .version (__name__ )
1219
1320__all__ = [
1421 "Alignment" ,
Original file line number Diff line number Diff line change 22from abc import abstractmethod
33from typing import TYPE_CHECKING
44
5- if sys .version_info >= (3 , 8 ):
5+ if TYPE_CHECKING or sys .version_info >= (3 , 8 ):
66 from typing import Protocol , runtime_checkable
77else :
88 from typing_extensions import Protocol , runtime_checkable
99
10- if TYPE_CHECKING :
11- from typing import Protocol
12-
1310
1411@runtime_checkable
1512class SupportsStr (Protocol ):
You can’t perform that action at this time.
0 commit comments