Skip to content

Commit

Permalink
Merge 07fda89 into 62144b5
Browse files Browse the repository at this point in the history
  • Loading branch information
gwax authored Jan 9, 2023
2 parents 62144b5 + 07fda89 commit aa58792
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 351 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
pre-commit:
runs-on: ubuntu-latest
name: Run all pre-commit checks
steps:
- uses: actions/checkout@v3

Expand All @@ -17,12 +18,8 @@ jobs:
python-version: "3.8"
cache: pip
cache-dependency-path: |
requirements.txt
test_requirements.txt
pyproject.toml
- run: >-
pip install
-r requirements.txt
-r test_requirements.txt
- run: pip install -e .[lxml,dev]

- uses: pre-commit/action@v3.0.0
12 changes: 7 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
name: publish
concurrency: publish

on: push

Expand All @@ -8,9 +9,11 @@ jobs:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4

- name: Install pypa/build
run: >-
Expand All @@ -27,12 +30,11 @@ jobs:
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
# TODO(gwax): use setuptools_scm instead of only pushing tags to test pypi
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.5.0
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ jobs:
python-version: "${{ matrix.python-version }}"
cache: pip
cache-dependency-path: |
requirements.txt
test_requirements.txt
- name: Install requirements
run: >-
pip install
-r requirements.txt
-r test_requirements.txt
pyproject.toml
- name: Install project
run: pip install -e .[lmxl,dev]

- name: Execute pytest
run: pytest tests/
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
lcov.info
*.lcov

# setuptools_scm generated files
mtg_ssm/_version.py

# Created by https://www.gitignore.io/api/python

### Python ###
Expand Down
6 changes: 5 additions & 1 deletion mtg_ssm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
"""Establish mtg_ssm package."""
from mtg_ssm.version import __version__

try:
from ._version import __version__
except ImportError:
__version__ = "unknown"
2 changes: 0 additions & 2 deletions mtg_ssm/version.py

This file was deleted.

13 changes: 0 additions & 13 deletions mypy.ini

This file was deleted.

138 changes: 138 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "mtg_ssm"
description = "A tool to manage Magic: the Gathering collection spreadsheets"
readme = "README.rst"
authors = [
{name = "George Leslie-Waksman", email ="waksman@gmail.com"},
]
requires-python = ">=3.8"
keywords = [
"mtg",
"magic",
"collection",
"tracking",
"spreadsheet",
]
license = {text = "MIT"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Games/Entertainment",
]

dependencies = [
"appdirs~=1.4",
"openpyxl~=3.0",
"pydantic~=1.9",
"requests~=2.27",
]
dynamic = ["version"]

[project.urls]
"Homepage" = "https://github.com/gwax/mtg_ssm"
"Bug Tracker" = "https://github.com/gwax/mtg_ssm/issues"

[project.scripts]
mtg-ssm = "mtg_ssm.ssm:main"

[project.optional-dependencies]
lxml = [
"lxml>=3.7.2",
]
dev = [
"black",
"coverage[toml]",
"doc8",
"flake8",
"flake8-bugbear",
"flake8-comprehensions",
"flake8-mutable",
"flake8-pyproject",
"freezegun",
"isort",
"lxml",
"mypy",
"openpyxl-stubs",
"pip",
"pip-tools",
"Pygments",
"pylint",
"pytest>=6.0",
"pytest-cov",
"pytest-snapshot",
"responses",
"setuptools>=45",
"setuptools-scm[toml]>=6.2",
"types-freezegun",
"types-requests",
"wheel",
]

[tool.setuptools]
packages = ["mtg_ssm"]

[tool.setuptools_scm]
write_to = "mtg_ssm/_version.py"
local_scheme = "no-local-version"

[tool.mypy]
python_version = "3.8"
plugins = "pydantic.mypy"

ignore_missing_imports = true
follow_imports = "normal"
disallow_untyped_defs = true
allow_untyped_globals = false

[tool.flake8]
ignore = ["E203", "E501", "F401", "W503"]
max_complexity = 10
exclude = [".git", "__pycache__", "build", "dist"]

[tool.pytest.ini_options]
xfail_strict = true
addopts = "--cov mtg_ssm --cov-report term-missing"
testpaths = ["tests"]

[tool.coverage.run]
omit = ["tests/**"]

[tool.coverage.report]
exclude_lines = [
"def __repr__",
"def __str__",
"if __name__ = .__main__.:",
]

[tool.isort]
profile = "black"
atomic = true
line_length = 88
known_first_party = [
"mtg_ssm",
"tests",
]
known_third_party = [
"freezegun",
"openpyxl",
"pytest",
"requests",
]
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

40 changes: 0 additions & 40 deletions setup.cfg

This file was deleted.

64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

28 changes: 0 additions & 28 deletions test_requirements.in

This file was deleted.

Loading

0 comments on commit aa58792

Please sign in to comment.