Skip to content

Commit

Permalink
bump ver, read version from init
Browse files Browse the repository at this point in the history
  • Loading branch information
leepc12 committed Apr 20, 2021
1 parent a091993 commit 495bffd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autouri/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from .s3uri import S3URI

__all__ = ["AbsPath", "AutoURI", "URIBase", "GCSURI", "HTTPURL", "S3URI"]
__version__ = "0.2.4"
__version__ = "0.2.5"
34 changes: 33 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,43 @@
import os
import re
from pathlib import Path

import setuptools

META_PATH = Path("autouri", "__init__.py")
HERE = os.path.abspath(os.path.dirname(__file__))


def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with Path(HERE, *parts).open(encoding="utf-8") as f:
return f.read()


META_FILE = read(META_PATH)


def find_meta(meta):
"""
Extract __*meta*__ from META_FILE.
"""
meta_match = re.search(
r"^__{meta}__ = ['\"]([^'\"]*)['\"]".format(meta=meta), META_FILE, re.M
)
if meta_match:
return meta_match.group(1)
raise


with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="autouri",
version="0.2.5",
version=find_meta("version"),
python_requires=">=3.6",
scripts=["bin/autouri"],
author="Jin wook Lee",
Expand Down

0 comments on commit 495bffd

Please sign in to comment.