From e051013e9aa2c17b4267feb82fcc306b2caffbb1 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 18 Mar 2020 00:00:17 +0000 Subject: [PATCH] bump package version --- README.adoc | 2 +- china-dictatorship.py | 11 ++--------- china_dictatorship/__init__.py | 8 ++++++++ package.json | 2 +- push-mirrors | 4 ++-- setup.py | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.adoc b/README.adoc index fa90237..9b820fa 100644 --- a/README.adoc +++ b/README.adoc @@ -4911,7 +4911,7 @@ china-dictatorship > README.html This would force China to also block package managers to block this repo. -We also managed to upload a Python PyPi package at: https://pypi.org/project/china-dictatorship/ Usage will be as: +We also managed to upload a Python PyPi package at: https://pypi.org/project/china-dictatorship/ Is as: .... python3 -m pip install --user --upgrade china-dictatorship diff --git a/china-dictatorship.py b/china-dictatorship.py index 0308b3f..ae5594a 100755 --- a/china-dictatorship.py +++ b/china-dictatorship.py @@ -1,11 +1,4 @@ #!/usr/bin/python3 -try: - import importlib.resources as importlib_resources -except ImportError: - # In PY<3.7 fall-back to backported `importlib_resources`. - import importlib_resources - -with importlib_resources.path('china_dictatorship', 'README.html') as readme_html_path: - with open(readme_html_path) as f: - print(f.read()) +import china_dictatorship +print(china_dictatorship.get_data(), end='') diff --git a/china_dictatorship/__init__.py b/china_dictatorship/__init__.py index e69de29..4278dc2 100644 --- a/china_dictatorship/__init__.py +++ b/china_dictatorship/__init__.py @@ -0,0 +1,8 @@ +try: + import importlib.resources as importlib_resources +except ImportError: + # In PY<3.7 fall-back to backported `importlib_resources`. + import importlib_resources + +def get_data(): + return importlib_resources.read_text(__name__, 'README.html') diff --git a/package.json b/package.json index b13d0cf..4a7b87e 100644 --- a/package.json +++ b/package.json @@ -21,5 +21,5 @@ "scripts": { "prepublishOnly": "cp README.adoc README;make" }, - "version": "0.0.51" + "version": "0.0.52" } diff --git a/push-mirrors b/push-mirrors index 7c52d9b..5153821 100755 --- a/push-mirrors +++ b/push-mirrors @@ -13,9 +13,9 @@ npm publish git add package.json # Python package. -# Initial one time setup. ./push-mirrors-bump-setup-py-version -python -m pip install --user setuptools wheel twine +# Initial one time setup. +#python3 -m pip install --user setuptools wheel twine cp README.adoc README.html china_dictatorship python setup.py sdist bdist_wheel # Asks for username and password every time, unless you setup ~/.pypirc. diff --git a/setup.py b/setup.py index 91c0a2e..8beaafc 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ with open(path.join(this_directory, 'README.adoc')) as f: setup( name='china-dictatorship', - version='0.0.51', + version='0.0.52', description='2018新疆改造中心,1989六四事件,1999法轮功 ,2019 996.ICU, 2018包子露宪,2015 710律师劫,2015巴拿马文件 邓家贵,2017低端人口,2008西藏骚乱', long_description=long_description, # Otherwise upload fails with: "The description failed to render in the default format of reStructuredText."