Skip to content

Commit

Permalink
Rename package from pyenvinfo to envinfopy
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Aug 27, 2020
1 parent 14462d5 commit 1f4f57d
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 35 deletions.
42 changes: 21 additions & 21 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
.. contents:: **pyenvinfo**
.. contents:: **envinfopy**
:backlinks: top
:depth: 2


Summary
============================================
.. image:: https://badge.fury.io/py/pyenvinfo.svg
:target: https://badge.fury.io/py/pyenvinfo
.. image:: https://badge.fury.io/py/envinfopy.svg
:target: https://badge.fury.io/py/envinfopy
:alt: PyPI package version

.. image:: https://img.shields.io/pypi/pyversions/pyenvinfo.svg
:target: https://pypi.org/project/pyenvinfo
.. image:: https://img.shields.io/pypi/pyversions/envinfopy.svg
:target: https://pypi.org/project/envinfopy
:alt: Supported Python versions

.. image:: https://img.shields.io/pypi/implementation/pyenvinfo.svg
:target: https://pypi.org/project/pyenvinfo
.. image:: https://img.shields.io/pypi/implementation/envinfopy.svg
:target: https://pypi.org/project/envinfopy
:alt: Supported Python implementations

.. image:: https://github.com/thombashi/pyenvinfo/workflows/Tests/badge.svg
:target: https://github.com/thombashi/pyenvinfo/actions?query=workflow%3ATests
.. image:: https://github.com/thombashi/envinfopy/workflows/Tests/badge.svg
:target: https://github.com/thombashi/envinfopy/actions?query=workflow%3ATests
:alt: Linux/macOS/Windows CI status

.. image:: https://coveralls.io/repos/github/thombashi/pyenvinfo/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/pyenvinfo?branch=master
.. image:: https://coveralls.io/repos/github/thombashi/envinfopy/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/envinfopy?branch=master
:alt: Test coverage: coveralls

pyenvinfo is a Python Library to get execution environment information.
envinfopy is a Python Library to get execution environment information.


Installation
============================================
::

pip install pyenvinfo
pip install envinfopy


Usage
Expand All @@ -42,29 +42,29 @@ Library usage
--------------------------------------------
.. code-block:: python
>>> import pyenvinfo
>>> pyenvinfo.get_envinfo(["pyenvinfo"])
{'uname': 'Linux ubuntu1804 4.15.0-112-generic x86_64', 'implementation': 'CPython', 'version': '3.8.5', 'pyenvinfo version': '0.0.1'}
>>> import envinfopy
>>> envinfopy.get_envinfo(["envinfopy"])
{'uname': 'Linux ubuntu1804 4.15.0-112-generic x86_64', 'implementation': 'CPython', 'version': '3.8.5', 'envinfopy version': '0.0.1'}
Get environment info as Markdown:

.. code-block:: python
>>> import pyenvinfo
>>> print(pyenvinfo.dumps(["pyenvinfo"], "markdown"))
>>> import envinfopy
>>> print(envinfopy.dumps(["envinfopy"], "markdown"))
- uname: Linux ubuntu1804 4.15.0-112-generic x86_64
- CPython version: 3.8.5
- pyenvinfo version: 0.0.1
- envinfopy version: 0.0.1
CLI usage
--------------------------------------------
::

$ python -m pyenvinfo --packages pyenvinfo
$ python -m envinfopy --packages envinfopy
uname: Linux ubuntu1804 4.15.0-112-generic x86_64
CPython version: 3.8.5
pyenvinfo version: 0.0.1
envinfopy version: 0.0.1


Dependencies
Expand Down
File renamed without changes.
11 changes: 8 additions & 3 deletions pyenvinfo/__main__.py → envinfopy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def parse_option() -> argparse.Namespace:
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=dedent(
"""\
Issue tracker: https://github.com/thombashi/pyenvinfo/issues
Issue tracker: https://github.com/thombashi/envinfopy/issues
"""
),
)
Expand All @@ -25,10 +25,15 @@ def parse_option() -> argparse.Namespace:
)

parser.add_argument(
"--packages", default="", help="comma-separated packages that extract versions.",
"--packages",
default="",
help="comma-separated packages that extract versions.",
)
parser.add_argument(
"--format", choices=["text", "markdown"], default="text", help="output format",
"--format",
choices=["text", "markdown"],
default="text",
help="output format",
)

return parser.parse_args()
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exclude = '''
'''

[tool.coverage.run]
source = ['pyenvinfo']
source = ['envinfopy']
branch = true

[tool.coverage.report]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import setuptools


MODULE_NAME = "pyenvinfo"
MODULE_NAME = "envinfopy"
REPOSITORY_URL = "https://github.com/thombashi/{:s}".format(MODULE_NAME)
REQUIREMENT_DIR = "requirements"
ENCODING = "utf8"
Expand Down
14 changes: 7 additions & 7 deletions tests/test_envinfo.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import re

import pyenvinfo
import envinfopy


RE_VERSION = re.compile(r"[0-9]\.[0-9]+\.[0-9]+", re.MULTILINE)


class Test_get_envinfo:
def test_normal(self):
envinfo = pyenvinfo.get_envinfo(["pytest", "pyenvinfo"])
envinfo = envinfopy.get_envinfo(["pytest", "envinfopy"])
print(envinfo)

assert len(envinfo["uname"]) >= 10
assert RE_VERSION.search(envinfo["version"])
assert RE_VERSION.search(envinfo["pytest version"])
assert RE_VERSION.search(envinfo["pyenvinfo version"])
assert RE_VERSION.search(envinfo["envinfopy version"])

def test_abnormal_not_installed(self):
envinfo = pyenvinfo.get_envinfo(["not-installed-pkg"])
envinfo = envinfopy.get_envinfo(["not-installed-pkg"])
print(envinfo)

assert len(envinfo["uname"]) >= 10
assert RE_VERSION.search(envinfo["version"])
assert envinfo["not-installed-pkg version"] == "not installed"

def test_abnormal_empty(self):
envinfo = pyenvinfo.get_envinfo([""])
envinfo = envinfopy.get_envinfo([""])

assert envinfo == pyenvinfo.get_envinfo()
assert envinfo == envinfopy.get_envinfo()


class Test_dumps:
def test_smoke(self):
output = pyenvinfo.dumps()
output = envinfopy.dumps()

assert len(output) > 20
assert RE_VERSION.search(output)
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ deps =
commands =
autoflake --in-place --recursive --remove-all-unused-imports --ignore-init-module-imports .
isort .
black setup.py tests pyenvinfo
black setup.py tests envinfopy

[testenv:lint]
basepython = python3.7
Expand All @@ -58,5 +58,5 @@ deps =
pylama
commands =
python setup.py check
-mypy pyenvinfo setup.py --ignore-missing-imports --show-error-context --show-error-codes --python-version 3.5
-mypy envinfopy setup.py --ignore-missing-imports --show-error-context --show-error-codes --python-version 3.5
-pylama

0 comments on commit 1f4f57d

Please sign in to comment.