Skip to content

Commit b969185

Browse files
fix: make dependencies and other build arguments static (#86)
Co-authored-by: Jonah Lawrence <[email protected]>
1 parent d22c423 commit b969185

File tree

7 files changed

+33
-68
lines changed

7 files changed

+33
-68
lines changed

Diff for: .github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
setup.py
5050
5151
- name: Install dependencies
52-
run: python -m pip install -r requirements.txt -e ".[dev]"
52+
run: python -m pip install -e ".[dev]"
5353

5454
- name: Set up pyright
5555
run: echo "PYRIGHT_VERSION=$(python -c 'import pyright; print(pyright.__pyright_version__)')" >> $GITHUB_ENV
@@ -94,7 +94,7 @@ jobs:
9494
setup.py
9595
9696
- name: Install dependencies
97-
run: python -m pip install -r requirements.txt -e ".[dev]" -e ".[docs]"
97+
run: python -m pip install -e ".[dev]" -e ".[docs]"
9898

9999
- name: Run mypy
100100
run: mypy .

Diff for: .github/workflows/python-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install dependencies
3030
run: |
3131
python -m pip install --upgrade pip
32-
python -m pip install -r requirements.txt -e ".[dev]"
32+
python -m pip install -e ".[dev]"
3333
python -m pip install --pre tox-gh-actions
3434
- name: Test with pytest
3535
run: |
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install dependencies
4949
run: |
5050
python -m pip install --upgrade pip
51-
python -m pip install -r requirements.txt -e ".[dev]"
51+
python -m pip install -e ".[dev]"
5252
python -m pip install --pre tox-gh-actions
5353
- name: Test with pytest
5454
run: tox

Diff for: pyproject.toml

+27-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
"wheel"
5-
]
2+
requires = ["setuptools>=42"]
63
build-backend = "setuptools.build_meta"
74

85

96
[project]
107
name = "table2ascii"
118
authors = [{name = "Jonah Lawrence", email = "[email protected]"}]
12-
dynamic = ["version", "description", "readme", "dependencies", "optional-dependencies"]
9+
dynamic = ["version"]
10+
description = "Convert 2D Python lists into Unicode/ASCII tables"
11+
readme = "README.md"
1312
requires-python = ">=3.7"
1413
license = {file = "LICENSE"}
1514
keywords = ["table", "ascii", "unicode", "formatter"]
@@ -38,7 +37,30 @@ classifiers = [
3837
"Topic :: Software Development :: Libraries :: Python Modules",
3938
"Typing :: Typed",
4039
]
40+
dependencies = [
41+
"typing-extensions>=3.7.4; python_version<'3.8'",
42+
"wcwidth<1",
43+
]
4144

45+
[project.optional-dependencies]
46+
docs = [
47+
"enum-tools",
48+
"sphinx",
49+
"sphinx-autobuild",
50+
"sphinx-toolbox",
51+
"sphinxcontrib_trio",
52+
"sphinxext-opengraph",
53+
"sphinx-book-theme==0.3.3",
54+
]
55+
dev = [
56+
"mypy>=0.982,<1",
57+
"pre-commit>=2.0.0,<3",
58+
"pyright>=1.0.0,<2",
59+
"pytest>=6.0.0,<8",
60+
"slotscheck>=0.1.0,<1",
61+
"taskipy>=1.0.0,<2",
62+
"tox>=3.0.0,<5",
63+
]
4264

4365
[project.urls]
4466
documentation = "https://table2ascii.rtfd.io"

Diff for: requirements.txt

-2
This file was deleted.

Diff for: setup.py

+1-55
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# /usr/bin/env python
2-
import os
32
import re
43

54
from setuptools import setup
@@ -14,57 +13,4 @@ def version():
1413
return version.group(1)
1514

1615

17-
def long_description():
18-
# check if README.md exists
19-
if not os.path.exists("README.md"):
20-
return ""
21-
with open("README.md", "r", encoding="utf-8") as fh:
22-
return fh.read()
23-
24-
25-
def requirements():
26-
# check if requirements.txt exists
27-
if not os.path.exists("requirements.txt"):
28-
return []
29-
with open("requirements.txt") as f:
30-
return f.read().splitlines()
31-
32-
33-
extras_require = {
34-
"docs": [
35-
"enum-tools",
36-
"sphinx",
37-
"sphinx-autobuild",
38-
"sphinx-toolbox",
39-
"sphinxcontrib_trio",
40-
"sphinxext-opengraph",
41-
"sphinx-book-theme==0.3.3",
42-
],
43-
"dev": [
44-
"mypy>=0.982,<1",
45-
"pre-commit>=2.0.0,<3",
46-
"pyright>=1.0.0,<2",
47-
"pytest>=6.0.0,<8",
48-
"slotscheck>=0.1.0,<1",
49-
"taskipy>=1.0.0,<2",
50-
"tox>=3.0.0,<5",
51-
],
52-
}
53-
54-
setup(
55-
name="table2ascii",
56-
version=version(),
57-
author="Jonah Lawrence",
58-
author_email="[email protected]",
59-
description="Convert 2D Python lists into Unicode/Ascii tables",
60-
long_description=long_description(),
61-
long_description_content_type="text/markdown",
62-
url="https://github.com/DenverCoder1/table2ascii",
63-
packages=["table2ascii"],
64-
install_requires=requirements(),
65-
extras_require=extras_require,
66-
setup_requires=[],
67-
tests_require=[
68-
"pytest>=6.2,<8",
69-
],
70-
)
16+
setup(name="table2ascii", version=version())

Diff for: table2ascii/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .table_style import TableStyle
99
from .table_to_ascii import table2ascii
1010

11-
__version__ = "1.0.3"
11+
__version__ = "1.0.4"
1212

1313
__all__ = [
1414
"Alignment",

Diff for: tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ envlist = py37, py38, py39, py310, py311
44
[testenv]
55
deps =
66
pytest
7-
-rrequirements.txt
87
commands = pytest tests -s

0 commit comments

Comments
 (0)