Skip to content

Commit 8cdef73

Browse files
committed
chore: Make version static in pyproject.toml
1 parent b969185 commit 8cdef73

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

Diff for: .github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
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 .

Diff for: CONTRIBUTING.md

+12
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ Install documentation dependencies with:
2424
pip 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

2941
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.

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
[project]
77
name = "table2ascii"
88
authors = [{name = "Jonah Lawrence", email = "[email protected]"}]
9-
dynamic = ["version"]
9+
version = "1.0.5"
1010
description = "Convert 2D Python lists into Unicode/ASCII tables"
1111
readme = "README.md"
1212
requires-python = ">=3.7"

Diff for: setup.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
# /usr/bin/env python
2-
import re
3-
42
from 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()

Diff for: table2ascii/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
"""
22
table2ascii - Library for converting 2D Python lists to fancy ASCII/Unicode tables
33
"""
4+
import importlib.metadata
45

56
from .alignment import Alignment
67
from .merge import Merge
78
from .preset_style import PresetStyle
89
from .table_style import TableStyle
910
from .table_to_ascii import table2ascii
1011

11-
__version__ = "1.0.4"
12+
__version__ = importlib.metadata.version(__name__)
1213

1314
__all__ = [
1415
"Alignment",

0 commit comments

Comments
 (0)