Skip to content

Commit

Permalink
About to release 0.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
bjodah committed Aug 7, 2021
1 parent 00cc98c commit 244c3a5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/adapted_grid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion finitediff/_release.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.6.4.dev0+git'
__version__ = '0.6.5.dev0+git'
2 changes: 1 addition & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# or
# $ ./scripts/run_tests.sh --cov pycvodes --cov-report html
${PYTHON:-python3} setup.py build_ext -i
${PYTHON:-python3} -m pytest --doctest-modules --pep8 --flakes $@
${PYTHON:-python3} -m pytest --doctest-modules --flake8 --flakes $@
${PYTHON:-python3} -m doctest README.rst
35 changes: 29 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
[flake8]

max-line-length = 119
extend-ignore = E203, W503

exclude =
.jupyter

ignore =
* W503 W504
__init__.py F401 F403
doc/conf.py ALL

[tool:pytest]
norecursedirs = .git .cache scripts build dist conda-recipe __pycache__ doc
pep8maxlinelength=119
pep8ignore =
doc/conf.py ALL
flakes-ignore =
__init__.py UnusedImport
doc/conf.py ALL
flake8-max-line-length = 119

flake8-ignore =
# E203: whitespace before colon on list slice
# E221: Multiple spaces before operator.
# E222: Multiple spaces after operator.
# E226: Missing space around arithmetic operator.
# E251: unexpected spaces around keyword/parameter equals
# F401: Multiple imports on one line.
# F403: Module import not at top of file.
# W503: Break before binary operator; warn on breaking after.
# W504: Break after binary operator; warn on breaking before.
* E203 W503 W504
__init__.py F401 F403
doc/conf.py ALL # conf.py is a generated file


#https://github.com/pytest-dev/pytest/issues/1445
[easy_install]
Expand Down
27 changes: 10 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,22 @@ def _path_under_setup(*args):
release_py_path = _path_under_setup(pkg_name, '_release.py')
config_py_path = _path_under_setup(pkg_name, '_config.py')
env = None # silence pyflakes, 'env' is actually set on the next line
exec(open(config_py_path).read())
with open(config_py_path) as ifh:
exec(ifh.read())
for k, v in list(env.items()):
env[k] = os.environ.get('%s_%s' % (pkg_name.upper(), k), v)

_version_env_var = '%s_RELEASE_VERSION' % pkg_name.upper()
RELEASE_VERSION = os.environ.get(_version_env_var, '')

# http://conda.pydata.org/docs/build.html#environment-variables-set-during-the-build-process
CONDA_BUILD = os.environ.get('CONDA_BUILD', '0') == '1'
if CONDA_BUILD:
try:
RELEASE_VERSION = 'v' + open(
'__conda_version__.txt', 'rt').readline().rstrip()
except IOError:
pass


if len(RELEASE_VERSION) > 1 and RELEASE_VERSION[0] == 'v':
TAGGED_RELEASE = True
__version__ = RELEASE_VERSION[1:]
else:
TAGGED_RELEASE = False
# read __version__ attribute from _release.py:
exec(io.open(release_py_path, encoding='utf-8').read())
with io.open(release_py_path, encoding='utf-8') as ifh:
exec(ifh.read())
if __version__.endswith('git'):
try:
_git_version = subprocess.check_output(
Expand Down Expand Up @@ -132,11 +124,12 @@ def _path_under_setup(*args):
short_description = f.read().split('"""')[1].split('\n')[1]
if not 10 < len(short_description) < 255:
warnings.warn("Short description from __init__.py proably not read correctly.")
long_description = io.open(_path_under_setup('README.rst'),
encoding='utf-8').read()
with io.open(_path_under_setup('README.rst'), encoding='utf-8') as ifh:
long_description = ifh.read()
if not len(long_description) > 100:
warnings.warn("Long description from README.rst probably not read correctly.")
_author, _author_email = io.open(_path_under_setup('AUTHORS'), 'rt', encoding='utf-8').readline().split('<')
with io.open(_path_under_setup('AUTHORS'), 'rt', encoding='utf-8') as ifh:
_author, _author_email = ifh.readline().split('<')


setup_kwargs = dict(
Expand Down Expand Up @@ -166,8 +159,8 @@ def _path_under_setup(*args):
# depending on tagged version (set FINITEDIFF_RELEASE_VERSION)
# this will ensure source distributions contain the correct version
shutil.move(release_py_path, release_py_path+'__temp__')
open(release_py_path, 'wt').write(
"__version__ = '{}'\n".format(__version__))
with open(release_py_path, 'wt') as ofh:
ofh.write("__version__ = '{}'\n".format(__version__))
shutil.move(config_py_path, config_py_path+'__temp__')
with open(config_py_path, 'wt') as fh:
fh.write("env = {}\n".format(pprint.pformat(env)))
Expand Down

0 comments on commit 244c3a5

Please sign in to comment.