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 94
94
setup.py
95
95
96
96
- name : Install dependencies
97
- run : python -m pip install -e ".[dev]" -e ".[ docs]"
97
+ run : python -m pip install -e ".[dev, docs]"
98
98
99
99
- name : Run mypy
100
100
run : mypy .
Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ Install documentation dependencies with:
24
24
pip install -e " .[docs]"
25
25
```
26
26
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
+
27
39
### Running the Tests
28
40
29
41
Run 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"
5
5
6
6
[project ]
7
7
name = " table2ascii"
8
+ version = " 1.1.0"
8
9
authors = [{name = " Jonah Lawrence" , email = " jonah@freshidea.com" }]
9
- dynamic = [" version" ]
10
10
description = " Convert 2D Python lists into Unicode/ASCII tables"
11
11
readme = " README.md"
12
12
requires-python = " >=3.7"
@@ -39,6 +39,7 @@ classifiers = [
39
39
]
40
40
dependencies = [
41
41
" typing-extensions>=3.7.4; python_version<'3.8'" ,
42
+ " importlib-metadata<5,>=1; python_version<'3.8'" ,
42
43
" wcwidth<1" ,
43
44
]
44
45
Original file line number Diff line number Diff line change 1
1
# /usr/bin/env python
2
- import re
3
-
4
2
from setuptools import setup
5
3
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 1
1
"""
2
2
table2ascii - Library for converting 2D Python lists to fancy ASCII/Unicode tables
3
3
"""
4
+ import sys
5
+ from typing import TYPE_CHECKING
4
6
5
7
from .alignment import Alignment
6
8
from .merge import Merge
7
9
from .preset_style import PresetStyle
8
10
from .table_style import TableStyle
9
11
from .table_to_ascii import table2ascii
10
12
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__ )
12
19
13
20
__all__ = [
14
21
"Alignment" ,
Original file line number Diff line number Diff line change 2
2
from abc import abstractmethod
3
3
from typing import TYPE_CHECKING
4
4
5
- if sys .version_info >= (3 , 8 ):
5
+ if TYPE_CHECKING or sys .version_info >= (3 , 8 ):
6
6
from typing import Protocol , runtime_checkable
7
7
else :
8
8
from typing_extensions import Protocol , runtime_checkable
9
9
10
- if TYPE_CHECKING :
11
- from typing import Protocol
12
-
13
10
14
11
@runtime_checkable
15
12
class SupportsStr (Protocol ):
You can’t perform that action at this time.
0 commit comments