From dc3a4cca42788b3c49aa8735a6f246b341bab3cc Mon Sep 17 00:00:00 2001 From: David Gustavsson Date: Tue, 24 Nov 2020 22:18:27 +0100 Subject: [PATCH] Preparation for PyPi --- .gitignore | 3 +++ Makefile | 12 +++++++++--- README.md | 7 ++++--- setup.py | 17 ++++++++++++++--- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 07bc1a0..6443403 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ README.html *.tex __pycache__ +LaTeXDatax.egg-info/ +build/ +dist/ diff --git a/Makefile b/Makefile index ab38548..584d18a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ -.PHONY: clean all test +.PHONY: clean all test publish -all: README.html test +all: README.html test dist/ + +dist/ : setup.py LaTeXDatax/datax.py + python $< sdist bdist_wheel test: tests/test_LaTeXDatax.py LaTeXDatax/datax.py pip install . @@ -9,5 +12,8 @@ test: tests/test_LaTeXDatax.py LaTeXDatax/datax.py README.html : README.md md2html --github $< -o $@ +publish : dist/ + python -m twine upload dist/* + clean : - rm -f __pycache__ README.html + rm -rf __pycache__/ LateXDatax/__pycache__/ README.html LaTeXDatax.egg-info/ build/ dist/ diff --git a/README.md b/README.md index a2275b0..cf2978c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ Import calculated values from a python script into a LaTeX document. This is a python interface for [the datax LaTeX package [ctan]](https://ctan.org/pkg/datax). ## Installation -One method that works, though it may not be *the way* in python, is downloading the repo, and running `pip install .` in the root directory of it. +``` +pip install "LaTeXDatax" +``` ## Usage In a python script: @@ -30,6 +32,5 @@ In the LaTeX document: ``` ## Looking for contributors -I don't know python very well. This should be a working package, but it would probably be better in more comfortable hands. -Specifically, I'm not sure how to distribute packages in the python ecosystem. +I don't know python very well. This package works, but if you have ideas for how to improve it, or you spot some python faux pas, feel free to make a PR or get in touch! diff --git a/setup.py b/setup.py index 180fea3..bfe9c72 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,24 @@ from setuptools import setup, find_packages +with open('README.md', 'r') as fh: + long_description = fh.read() + setup( name='LaTeXDatax', - version='1.0', - description='Export python variables to LaTeX documents', + version='1.1', author='David Gustavsson', author_email='david.e.gustavsson@gmail.com', + description='Export individual data from a Python script to a LaTeX document', + long_description=long_description, + long_description_content_type='text/markdown', + url='https://github.com/Datax-package/LaTeXDatax.py', packages=find_packages(), - install_requires=[], + classifiers=[ + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + ], + python_requires='>=3.6', )