Skip to content

Commit

Permalink
Merge branch 'master' into unicode-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lieryan committed Nov 25, 2022
2 parents 2fe98b0 + c0433a8 commit e71c145
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

- ...

# Release 1.5.1

- #531 Add alternative way to retrieve version number from pyproject.toml

# Release 1.5.0

- #492 Feat: Global configuration support (@bagel897)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -20,7 +20,7 @@ classifiers = [
'Programming Language :: Python :: 3.10',
'Topic :: Software Development',
]
version = '1.5.0'
version = '1.5.1'
dependencies = ['pytoolconfig[global] >= 1.2.2']

[[project.authors]]
Expand Down
19 changes: 17 additions & 2 deletions rope/__init__.py
@@ -1,10 +1,25 @@
"""rope, a python refactoring library"""

from pkg_resources import get_distribution
from pkg_resources import get_distribution, DistributionNotFound

try:
VERSION = get_distribution("rope").version
except DistributionNotFound:

def get_fallback_version():
import re
import pathlib

pyproject = (
pathlib.Path(__file__).resolve().parent.parent / "pyproject.toml"
).read_text()
version = re.search("version.*=.*'(.*)'", pyproject)
return version.group(1) if version else None

VERSION = get_fallback_version()


INFO = __doc__
VERSION = get_distribution("rope").version
COPYRIGHT = """\
Copyright (C) 2021-2022 Lie Ryan
Copyright (C) 2019-2021 Matej Cepl
Expand Down

0 comments on commit e71c145

Please sign in to comment.