From 5ca4ce19fc2d9b5f41441fb9163810f8ca502e79 Mon Sep 17 00:00:00 2001 From: Honza Mach <honza.mach.ml@gmail.com> Date: Thu, 9 Mar 2017 10:45:11 +0100 Subject: [PATCH] Improved overall package structure Following minor updates: - improved deployment makefile - gitignore file added for versioning - improved default readme and license files - improved Python package setup (added unit test support) - generated and deployed latest version to PyPI --- .gitignore | 13 ++++++++---- LICENSE.txt | 2 +- Makefile-dep | 44 ++++++++++++++++++++++++++++++++++++++++ README.rst | 17 +++++++++++++++- archive/.git.placeholder | 0 dist/.git.placeholder | 0 setup.py | 12 ++++++++--- 7 files changed, 79 insertions(+), 9 deletions(-) create mode 100644 Makefile-dep create mode 100644 archive/.git.placeholder create mode 100644 dist/.git.placeholder diff --git a/.gitignore b/.gitignore index 29b16e3..ac2ffeb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,15 @@ +!.gitignore +.directory +*~ +*.log + # Compiled python modules. *.pyc -# Setuptools distribution folder. -/dist/ -/build/ - # Python egg metadata, regenerated from source files by setuptools. /*.egg-info +# Package building related folders. +/archive/pydgets* +/build/ +/dist/pydgets* diff --git a/LICENSE.txt b/LICENSE.txt index 9f9d108..224316f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Honza Mach +Copyright (C) since 2016 Jan Mach <honza.mach.ml@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile-dep b/Makefile-dep new file mode 100644 index 0000000..d89cc32 --- /dev/null +++ b/Makefile-dep @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------- +# Copyright (C) since 2016 Jan Mach <honza.mach.ml@gmail.com> +# Use of this source is governed by the MIT license, see LICENSE file. +#------------------------------------------------------------------------------- + +DOCDIR = doc +DIST_SIZE:=$(shell ls dist | wc -l) + +all: archive bdist deploy + +# Perform unit tests +test: + $(info Testing source code) + nosetests + +# Move old distribution files to archive directory +archive: + $(info Checking if dist archivation is needed) + @if ! [ `ls dist | wc -l` = "0" ]; then\ + echo "Moving old distribution files to archive";\ + mv -f dist/* archive;\ + fi + +# Build various Python package distributions +bdist: + $(info Building distributions) + + # Build and upload (insecure) + #python3 setup.py sdist bdist_wheel upload + + # Build only + python3 setup.py sdist bdist_wheel + +# Perform installation from local files for both Python v2 and v3 +install: + $(info Local installation) + sudo pip3 install dist/idea*.whl + +# Deploy latest packages to PyPI +deploy: + $(info PyPI deployment) + + # Secure upload with Twine + twine upload dist/* diff --git a/README.rst b/README.rst index 920094a..6b4675c 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,19 @@ Pydgets -======================= +================================================================================ Python3 command line widget library. + +.. warning:: + + This library is still work in progress. + +.. note:: + + For usage and examples please see the source code, for demonstration execute + the appropriate module with Python3 interpreter. + +Copyright +-------------------------------------------------------------------------------- + +Copyright (C) since 2016 Jan Mach <honza.mach.ml@gmail.com> +Use of this package is governed by the MIT license, see LICENSE file. diff --git a/archive/.git.placeholder b/archive/.git.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/dist/.git.placeholder b/dist/.git.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index b7f9439..d368ac5 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,14 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- #------------------------------------------------------------------------------- -# Copyright (C) 2015-2016 Jan Mach <honza.mach.ml@gmail.com> +# Copyright (C) 2015-2016 Jan Mach <email@jan-mach.cz> # Use of this source is governed by the MIT license, see LICENSE file. #------------------------------------------------------------------------------- +# Resources: +# https://packaging.python.org/en/latest/ +# https://python-packaging.readthedocs.io/en/latest/index.html + # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding @@ -16,10 +20,10 @@ here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() - + setup( name = 'pydgets', - version = '0.3', + version = '0.6', description = 'Console widget library for Python 3', long_description = long_description, classifiers = [ @@ -34,6 +38,8 @@ setup( author_email = 'email@jan-mach.cz', license = 'MIT', packages = ['pydgets'], + test_suite = 'nose.collector', + tests_require = ['nose'], include_package_data = True, zip_safe = False ) -- GitLab