Skip to content

Commit

Permalink
Merge pull request #32 from yymao/u/yymao/fix-nested-set
Browse files Browse the repository at this point in the history
Fix "possible nested set" futurewarning
  • Loading branch information
yymao committed Sep 22, 2022
2 parents bf00cfc + 6af4915 commit f829e7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions adstex.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
from builtins import input
from collections import defaultdict
from datetime import date
from distutils.version import StrictVersion
from shutil import copyfile

import ads
import bibtexparser
import packaging.version
import requests

try:
from urllib.parse import unquote
except ImportError:
from urllib import unquote

__version__ = "0.3.11"
__version__ = "0.3.12"

_this_year = date.today().year % 100
_this_cent = date.today().year // 100

_re_comment = re.compile(r"(?<!\\)%.*(?=[\r\n])")
_re_bib = re.compile(r"\\(?:no)?bibliography\*?(?:(?!\n{2,})\s)*{((?:(?!\n{2,})[^{}])+)}")
_re_cite = re.compile(
r"\\(?:bibentry|[cC]ite[a-zA]{0,7})\*?(?:(?!\n{2,})\s)*(?:(?<!\\)[[<](?:(?!\n{2,}).)*?(?<!\\)[]>](?:(?!\n{2,})\s)*)*{((?:(?!\n{2,})[^{}])+)}",
r"\\(?:bibentry|[cC]ite[a-zA]{0,7})\*?(?:(?!\n{2,})\s)*(?:(?<!\\)[\[<](?:(?!\n{2,}).)*?(?<!\\)[\]>](?:(?!\n{2,})\s)*)*{((?:(?!\n{2,})[^{}])+)}",
re.S,
)
_re_fayear = re.compile(r"([A-Za-z-]+)(?:(?=[\W_])[^\s\d,]+)?((?:\d{2})?\d{2})")
Expand Down Expand Up @@ -469,15 +469,15 @@ def main():

# check version
try:
latest_version = StrictVersion(
latest_version = packaging.version.parse(
requests.get(
"https://pypi.python.org/pypi/adstex/json", timeout=0.1,
).json()["info"]["version"]
)
except (requests.RequestException, KeyError, ValueError):
pass
else:
if latest_version > StrictVersion(__version__):
if latest_version > packaging.version.parse(__version__):
msg = "A newer version of adstex (v{}) is now available!\n".format(
latest_version
)
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Astronomy",
],
keywords="bibtex ads",
Expand All @@ -53,6 +56,7 @@
"ads>=0.12.3",
"bibtexparser>=0.6.2",
"requests>=2.0",
"packaging>=17.0",
"future>=0.12.0 ; python_version < '3.0'",
],
entry_points={"console_scripts": ["adstex=adstex:main"]},
Expand Down

0 comments on commit f829e7f

Please sign in to comment.