Skip to content

Commit

Permalink
Admin: update setup.py to get version
Browse files Browse the repository at this point in the history
  • Loading branch information
jmahlik committed Oct 19, 2023
1 parent 436fd43 commit 6d61e07
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from setuptools import setup, find_packages
import os


def get_version(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path), 'r') as f:
for line in f.readlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError('Unable to find version string.')

from flake8_use_fstring import __version__

extra_test = [
'coverage==4.*',
Expand All @@ -25,7 +36,7 @@

setup(
name='flake8-use-fstring',
version=__version__,
version=get_version('flake8_use_fstring/__init__.py'),
description='Flake8 plugin for string formatting style.',

url='https://github.com/MichaelKim0407/flake8-use-fstring',
Expand Down

0 comments on commit 6d61e07

Please sign in to comment.