Skip to content

fix: make dependencies and other build arguments static #86

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

Merged
merged 3 commits into from
Dec 19, 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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
setup.py

- name: Install dependencies
run: python -m pip install -r requirements.txt -e ".[dev]"
run: python -m pip install -e ".[dev]"

- name: Set up pyright
run: echo "PYRIGHT_VERSION=$(python -c 'import pyright; print(pyright.__pyright_version__)')" >> $GITHUB_ENV
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
setup.py

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

- name: Run mypy
run: mypy .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt -e ".[dev]"
python -m pip install -e ".[dev]"
python -m pip install --pre tox-gh-actions
- name: Test with pytest
run: |
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt -e ".[dev]"
python -m pip install -e ".[dev]"
python -m pip install --pre tox-gh-actions
- name: Test with pytest
run: tox
Expand Down
32 changes: 27 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"


[project]
name = "table2ascii"
authors = [{name = "Jonah Lawrence", email = "[email protected]"}]
dynamic = ["version", "description", "readme", "dependencies", "optional-dependencies"]
dynamic = ["version"]
description = "Convert 2D Python lists into Unicode/ASCII tables"
readme = "README.md"
requires-python = ">=3.7"
license = {file = "LICENSE"}
keywords = ["table", "ascii", "unicode", "formatter"]
Expand Down Expand Up @@ -38,7 +37,30 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"typing-extensions>=3.7.4; python_version<'3.8'",
"wcwidth<1",
]

[project.optional-dependencies]
docs = [
"enum-tools",
"sphinx",
"sphinx-autobuild",
"sphinx-toolbox",
"sphinxcontrib_trio",
"sphinxext-opengraph",
"sphinx-book-theme==0.3.3",
]
dev = [
"mypy>=0.982,<1",
"pre-commit>=2.0.0,<3",
"pyright>=1.0.0,<2",
"pytest>=6.0.0,<8",
"slotscheck>=0.1.0,<1",
"taskipy>=1.0.0,<2",
"tox>=3.0.0,<5",
]

[project.urls]
documentation = "https://table2ascii.rtfd.io"
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

56 changes: 1 addition & 55 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# /usr/bin/env python
import os
import re

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


def long_description():
# check if README.md exists
if not os.path.exists("README.md"):
return ""
with open("README.md", "r", encoding="utf-8") as fh:
return fh.read()


def requirements():
# check if requirements.txt exists
if not os.path.exists("requirements.txt"):
return []
with open("requirements.txt") as f:
return f.read().splitlines()


extras_require = {
"docs": [
"enum-tools",
"sphinx",
"sphinx-autobuild",
"sphinx-toolbox",
"sphinxcontrib_trio",
"sphinxext-opengraph",
"sphinx-book-theme==0.3.3",
],
"dev": [
"mypy>=0.982,<1",
"pre-commit>=2.0.0,<3",
"pyright>=1.0.0,<2",
"pytest>=6.0.0,<8",
"slotscheck>=0.1.0,<1",
"taskipy>=1.0.0,<2",
"tox>=3.0.0,<5",
],
}

setup(
name="table2ascii",
version=version(),
author="Jonah Lawrence",
author_email="[email protected]",
description="Convert 2D Python lists into Unicode/Ascii tables",
long_description=long_description(),
long_description_content_type="text/markdown",
url="https://github.com/DenverCoder1/table2ascii",
packages=["table2ascii"],
install_requires=requirements(),
extras_require=extras_require,
setup_requires=[],
tests_require=[
"pytest>=6.2,<8",
],
)
setup(name="table2ascii", version=version())
2 changes: 1 addition & 1 deletion table2ascii/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .table_style import TableStyle
from .table_to_ascii import table2ascii

__version__ = "1.0.3"
__version__ = "1.0.4"

__all__ = [
"Alignment",
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ envlist = py37, py38, py39, py310, py311
[testenv]
deps =
pytest
-rrequirements.txt
commands = pytest tests -s