Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Make version static in pyproject.toml #87

Merged
merged 10 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
setup.py

- name: Install dependencies
run: python -m pip install -e ".[dev]" -e ".[docs]"
run: python -m pip install -e ".[dev,docs]"

- name: Run mypy
run: mypy .
Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ Install documentation dependencies with:
pip install -e ".[docs]"
```

Install runtime dependencies with:

```bash
pip install -e .
```

All dependencies can be installed at once with:

```bash
pip install -e ".[dev,docs]"
```

### Running the Tests

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.
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ build-backend = "setuptools.build_meta"

[project]
name = "table2ascii"
version = "1.1.0"
authors = [{name = "Jonah Lawrence", email = "[email protected]"}]
dynamic = ["version"]
description = "Convert 2D Python lists into Unicode/ASCII tables"
readme = "README.md"
requires-python = ">=3.7"
Expand Down Expand Up @@ -39,6 +39,7 @@ classifiers = [
]
dependencies = [
"typing-extensions>=3.7.4; python_version<'3.8'",
"importlib-metadata<5,>=1; python_version<'3.8'",
"wcwidth<1",
]

Expand Down
14 changes: 1 addition & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# /usr/bin/env python
import re

from setuptools import setup


def version():
version = ""
with open("table2ascii/__init__.py") as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE)
if not version:
raise RuntimeError("version is not set")
return version.group(1)


setup(name="table2ascii", version=version())
setup()
9 changes: 8 additions & 1 deletion table2ascii/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
"""
table2ascii - Library for converting 2D Python lists to fancy ASCII/Unicode tables
"""
import sys
from typing import TYPE_CHECKING

from .alignment import Alignment
from .merge import Merge
from .preset_style import PresetStyle
from .table_style import TableStyle
from .table_to_ascii import table2ascii

__version__ = "1.0.4"
if TYPE_CHECKING or sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

__version__ = metadata.version(__name__)

__all__ = [
"Alignment",
Expand Down
5 changes: 1 addition & 4 deletions table2ascii/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
from abc import abstractmethod
from typing import TYPE_CHECKING

if sys.version_info >= (3, 8):
if TYPE_CHECKING or sys.version_info >= (3, 8):
from typing import Protocol, runtime_checkable
else:
from typing_extensions import Protocol, runtime_checkable

if TYPE_CHECKING:
from typing import Protocol


@runtime_checkable
class SupportsStr(Protocol):
Expand Down