-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile.pypi
16 lines (16 loc) · 1.56 KB
/
Makefile.pypi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- mode: Makefile -*-
check-if-jianpuly-version-is-changing:
@if grep '^# v[0-9][^.]*[.][0-9][0-9][0-9][0-9]' jianpu-ly.py; 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 '^[+]# v[0-9]'; then make -f Makefile.pypi update-jianpuly-pypi; else true; fi
update-jianpuly-pypi:
mkdir jianpu_ly
cp jianpu-ly.py jianpu_ly/__init__.py
echo "import jianpu_ly;jianpu_ly.main()" > jianpu_ly/__main__.py
echo "from setuptools import setup, find_packages;setup(name='jianpu_ly',version='$$(grep '^# v[0-9]' jianpu-ly.py|sed -e 's/[^ ]* v//' -e 's/ .*//' -e 's/[.][1-9]$$/&0/' -e 's/[.][0-9][0-9]$$/&0/')',entry_points={'console_scripts':['jianpu-ly=jianpu_ly.__init__:main']},license='Apache 2',platforms='any',url='http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html',author='Silas S. Brown',author_email='ssb$$(echo 22@ca)m.ac.uk',description='Jianpu in Lilypond',long_description=r'''$$(grep -v 'also mirrored' < README.md)''',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.6')" > setup.py
mv README.md .. # or it'll override our altered version
python3 setup.py sdist
twine upload dist/*
mv ../README.md .
rm -r jianpu_ly.egg-info dist jianpu_ly setup.py
.PHONY: check-if-jianpuly-version-is-changing
.PHONY: update-jianpuly-pypi