-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A little bit of clean parsing code in setup.py and the enforcement from `black`, and it becomes possible to ditch a file which only held a single value. Similarly update the version parsing in the makefile.
- Loading branch information
Showing
4 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from nose2._version import __version__ | ||
from nose2.main import discover, main | ||
|
||
__version__ = "0.12.0" | ||
|
||
__all__ = ("__version__", "discover", "main") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import os | ||
import re | ||
|
||
from setuptools import find_packages, setup | ||
|
||
VERSION = open("nose2/_version.py").readlines()[-1].split()[-1].strip("\"'") | ||
|
||
def read_version(filename): | ||
# use of " over ' will be enforced by "black" | ||
version_pattern = re.compile(r'__version__ = "([^"]*)"') | ||
with open(filename) as fp: | ||
for line in fp: | ||
m = version_pattern.match(line) | ||
if m: | ||
return m.group(1) | ||
raise Exception("could not parse version from {}".format(filename)) | ||
|
||
|
||
MAINTAINER = "Stephen Rosen" | ||
MAINTAINER_EMAIL = "[email protected]" | ||
|
@@ -11,7 +22,7 @@ | |
|
||
setup( | ||
name="nose2", | ||
version=VERSION, | ||
version=read_version("nose2/__init__.py"), | ||
packages=find_packages(), | ||
extras_require={ | ||
"coverage_plugin": ["coverage"], | ||
|