-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.pypi
16 lines (16 loc) · 1.67 KB
/
Makefile.pypi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- mode: Makefile -*-
check-if-webcheck-version-is-changing:
@if python3 webcheck.py --version|grep 'v[0-9][^.]*[.][0-9][0-9][0-9][0-9]'; then echo "4+ decimal digits in version number will now need another -e 's/[.][0-9][0-9][0-9]$$/&0/' in Makefile.pypi's sed expression"; false; fi
if (git diff;git diff --staged)|grep '^[+]"""webcheck.py v[0-9]'; then make -f Makefile.pypi update-webcheck-pypi; else true; fi
update-webcheck-pypi:
mkdir webcheck
cp webcheck.py webcheck/__init__.py
echo "import webcheck;webcheck.main()" > webcheck/__main__.py
echo "from setuptools import setup, find_packages;setup(name='webcheck_strings',version='$$(python3 webcheck.py --version|head 1|sed -e 's/[^v]*v//' -e 's/ .*//' -e 's/[.][1-9]$$/&0/' -e 's/[.][0-9][0-9]$$/&0/')',entry_points={'console_scripts':['webcheck=webcheck.__init__:main']},license='Apache 2',platforms='any',url='http://ssb22.user.srcf.net/setup/webcheck.html',author='Silas S. Brown',author_email='ssb$$(echo 22@ca)m.ac.uk',description='Monitor text strings on websites',long_description=r'''$$(sed -e 's/[(]also mirrored[^)]*)//' < README.md | awk 'BEGIN {p=1} /^ImapFix/ {p=0} //{if(p) print}')''',long_description_content_type='text/markdown',packages=find_packages(),classifiers=['Programming Language :: Python :: 2','Programming Language :: Python :: 3','License :: OSI Approved :: Apache Software License','Operating System :: OS Independent'],python_requires='>=2.3')" > setup.py
mv README.md .. # or it'll override our altered version
python3 setup.py sdist
twine upload dist/*
mv ../README.md .
rm -r webcheck_strings.egg-info dist webcheck setup.py
.PHONY: check-if-webcheck-version-is-changing
.PHONY: update-webcheck-pypi