Skip to content

Commit

Permalink
Merge pull request #197 from jGaboardi/update_gitcount
Browse files Browse the repository at this point in the history
access package version in tools/gitcount
  • Loading branch information
jGaboardi authored Oct 3, 2021
2 parents d08de02 + a83bbd8 commit 42356de
Showing 1 changed file with 25 additions and 30 deletions.
55 changes: 25 additions & 30 deletions tools/gitcount.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@
"source": [
"# get date of last tag\n",
"from subprocess import Popen, PIPE\n",
"x, err = Popen('git log -1 --tags --simplify-by-decoration --pretty=\"%ai\"| cat', stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True).communicate()\n",
"x, err = Popen(\n",
" 'git log -1 --tags --simplify-by-decoration --pretty=\"%ai\"| cat',\n",
" stdin=PIPE,\n",
" stdout=PIPE,\n",
" stderr=PIPE,\n",
" shell=True\n",
").communicate()\n",
"start_date = x.split()[0].decode('utf-8')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"err"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -100,7 +97,7 @@
"import ssl\n",
"import yaml\n",
"\n",
"context = ssl._create_unverified_context()\n"
"context = ssl._create_unverified_context()"
]
},
{
Expand All @@ -109,7 +106,8 @@
"metadata": {},
"outputs": [],
"source": [
"CWD = os.path.abspath(os.path.curdir)"
"CWD = os.path.abspath(os.path.curdir)\n",
"CWD"
]
},
{
Expand All @@ -118,7 +116,10 @@
"metadata": {},
"outputs": [],
"source": [
"CWD"
"since_date = '--since=\"{start}\"'.format(start=start_date)\n",
"since_date\n",
"since = datetime.strptime(start_date+\" 0:0:0\", \"%Y-%m-%d %H:%M:%S\")\n",
"since"
]
},
{
Expand All @@ -127,10 +128,8 @@
"metadata": {},
"outputs": [],
"source": [
"since_date = '--since=\"{start}\"'.format(start=start_date)\n",
"since_date\n",
"since = datetime.strptime(start_date+\" 0:0:0\", \"%Y-%m-%d %H:%M:%S\")\n",
"since"
"# get __version__\n",
"%run ../spopt/_version.py"
]
},
{
Expand All @@ -139,12 +138,7 @@
"metadata": {},
"outputs": [],
"source": [
"# get __version__\n",
"f = \"../{package}/__init__.py\".format(package=package_name)\n",
"\n",
"with open(f, 'r') as initfile:\n",
" exec(initfile.readline())\n",
" "
"__version__ = get_versions()[\"version\"]"
]
},
{
Expand Down Expand Up @@ -193,10 +187,11 @@
"metadata": {},
"outputs": [],
"source": [
"identities = {'Levi John Wolf': ('ljwolf', 'Levi John Wolf'),\n",
" 'Serge Rey': ('Serge Rey', 'Sergio Rey', 'sjsrey', 'serge'),\n",
" 'Wei Kang': ('Wei Kang', 'weikang9009'),\n",
" 'Dani Arribas-Bel': ('Dani Arribas-Bel', 'darribas')\n",
"identities = {\n",
" 'Levi John Wolf': ('ljwolf', 'Levi John Wolf'),\n",
" 'Serge Rey': ('Serge Rey', 'Sergio Rey', 'sjsrey', 'serge'),\n",
" 'Wei Kang': ('Wei Kang', 'weikang9009'),\n",
" 'Dani Arribas-Bel': ('Dani Arribas-Bel', 'darribas')\n",
"}\n",
"\n",
"def regularize_identity(string):\n",
Expand Down Expand Up @@ -579,9 +574,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:spopt]",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "conda-env-spopt-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -593,7 +588,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.9.7"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down

0 comments on commit 42356de

Please sign in to comment.