Skip to content
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
12 changes: 6 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ jobs:
- name: Install dependencies in GHA
run: |
python -m pip install --upgrade pip
pipenv install --deploy --dev
pip install -e ".[dev]"
- name: Lint with pylint
run: |
pipenv run flake8 src/k2hr3client
pipenv run mypy src/k2hr3client
pipenv run pylint src/k2hr3client
pipenv run python3 setup.py checkdocs
flake8 src/k2hr3client
mypy src/k2hr3client
pylint src/k2hr3client
python3 setup.py checkdocs
shell: sh
- name: Test with unittest
run: |
pipenv run python3 -m unittest discover src
python3 -m unittest discover src
shell: sh
- name: Install dependencies for upload pypi package
if: startsWith(github.ref, 'refs/tags')
Expand Down
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ BROWSER := python3 -c "$$BROWSER_PYSCRIPT"
help:
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

init:
python3 -m pip install pipenv
pipenv install --skip-lock
pipenv graph
pipenv install --dev
init: ## Install dependencies and development dependencies
python3 -m pip install -e .
python3 -m pip install -e ".[dev]"

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

Expand Down
30 changes: 0 additions & 30 deletions Pipfile

This file was deleted.

1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ Development
Clone this repository and go into the directory, then run the following command::

$ make init
$ pipenv shell
$ make lint test docs build


Expand Down
30 changes: 29 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "k2hr3client"
dynamic = ["version"]
version = "1.1.3"
requires-python = ">=3.9"
authors = [
{name = "Hirotaka Wakabayashi", email = "hiwakaba@lycorp.co.jp"},
Expand All @@ -29,6 +29,34 @@ classifiers = [
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
]
dependencies = [
"requests",
"urllib3",
"setuptools",
]

[project.optional-dependencies]
dev = [
"coverage",
"flake8",
"flake8-docstrings",
"pep8-naming",
"pycodestyle",
"mccabe",
"sphinx-autoapi",
"sphinx-intl",
"sphinx-rtd-theme",
"sphinx",
"watchdog",
"wheel",
"twine",
"pylint",
"astroid",
"mypy",
"collective.checkdocs",
"tomli",
"dill",
]

[project.urls]
Homepage = "https://github.com/yahoojapan/k2hr3client_python"
Expand Down
24 changes: 2 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,8 @@
# Always prefer setuptools over distutils
from setuptools import setup


def get_version():
"""Returns the package version from __ini__.py."""
from pathlib import Path
from os import path, sep
import re

here = path.abspath(path.dirname(__file__))
init_py = Path(sep.join([here, 'src', 'k2hr3client', '__init__.py'])).resolve()

with init_py.open() as fp:
for line in fp:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
line.strip(), re.M)
if version_match:
return version_match.group(1)
raise RuntimeError('version expected, but no version found.')


setup(
version=get_version(),
)
# All configuration is now in pyproject.toml
setup()

#
# Local variables:
Expand Down
15 changes: 12 additions & 3 deletions src/k2hr3client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@
"""K2HR3 Python Client of Token API."""

__author__ = 'Hirotaka Wakabayashi <hiwakaba@lycorp.co.jp>'
__version__ = '1.1.3'

import configparser
import logging
from logging.handlers import TimedRotatingFileHandler
import sys
from importlib.metadata import PackageNotFoundError, \
version as get_version_info
from logging import StreamHandler
from logging.handlers import TimedRotatingFileHandler
from pathlib import Path
import sys

from k2hr3client import version # noqa: F401


try:
__version__ = get_version_info("k2hr3client")
except PackageNotFoundError:
__version__ = "unknown"

LOG = logging.getLogger(__name__)

Expand Down
Loading