diff --git a/.gitignore b/.gitignore index 073abe937e909726ff8e9579f3dbcc52e28a7d98..42797bcb9b2d7df8dbf3f8e3cbed564557f86eaa 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ *.tbz2 *.txz *.deb +*.whl # Python related stuff. *.pyc @@ -32,3 +33,9 @@ parsetab.py # Ignore Sphinx-doc documentation build directory /doc/sphinx/_build/ + +# Ignore build metadata for separate packages + +# Pynspect +/deploy/pynspect/build/ +/deploy/pynspect/pynspect/ diff --git a/deploy/pynspect/LICENSE.txt b/deploy/pynspect/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..18202f1e946329bf84dd5dbfc4a259af90cfe234 --- /dev/null +++ b/deploy/pynspect/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) since 2011 CESNET, z.s.p.o + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deploy/pynspect/Makefile b/deploy/pynspect/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..095672453b81c3d24c88a4e48163dbca780f5b25 --- /dev/null +++ b/deploy/pynspect/Makefile @@ -0,0 +1,69 @@ +#------------------------------------------------------------------------------- +# Copyright (c) since 2016, CESNET, z. s. p. o. +# Authors: Pavel Kácha <pavel.kacha@cesnet.cz> +# Jan Mach <jan.mach@cesnet.cz> +# Use of this source is governed by an ISC license, see LICENSE file. +#------------------------------------------------------------------------------- + +all: archive sync bdist deploy + +build: archive sync bdist + +help: + $(info List of possible make targets:) + $(info ) + $(info * all: archive previous packages, build new distribution and deploy to PyPI [default]) + $(info * build: archive previous packages and build new distribution) + $(info * test: run unit tests) + $(info * archive: archive previous packages) + $(info * sync: synchronize source code) + $(info * bdist: build new distribution) + $(info * install: install distribution on local machine) + $(info * deploy: deploy to PyPI) + $(info ) + +# Perform unit tests +test: FORCE + $(info Testing source code) + nosetests + +# Move old distribution files to archive directory +archive: FORCE + $(info Checking if dist archivation is needed) + @if ! [ `ls dist/pynspect* | wc -l` = "0" ]; then\ + echo "Moving old distribution files to local archive";\ + mv -f dist/pynspect* archive;\ + fi + +# Synchronize directory contentc +sync: FORCE + $(info Syncing source code) + rsync -r --progress --archive --update --delete --force ../../lib/pynspect/ ./pynspect/ + +# 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 --universal + python3 setup.py sdist bdist_wheel + +# Perform installation from local files for both Python 2 and 3 +install: FORCE + $(info Local installation) + pip install dist/pynspect*.whl + pip3 install dist/pynspect*.whl + +# Deploy latest packages to PyPI +deploy: FORCE + $(info PyPI deployment) + + # Secure upload with Twine + twine upload dist/pynspect* + +# Empty rule as dependency wil force make to always perform target +# Source: https://www.gnu.org/software/make/manual/html_node/Force-Targets.html +FORCE: diff --git a/deploy/pynspect/README.rst b/deploy/pynspect/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..230af994ee87ee4e133add7cf21b3921daa90641 --- /dev/null +++ b/deploy/pynspect/README.rst @@ -0,0 +1,8 @@ +pynspect +================================================================================ + +Python 3 library for filtering, querying or inspecting almost arbitrary data +structures. + +This README file is work in progress, for more information please consult source +code and unit tests. diff --git a/deploy/pynspect/archive/.gitplaceholder b/deploy/pynspect/archive/.gitplaceholder new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/deploy/pynspect/dist/.gitplaceholder b/deploy/pynspect/dist/.gitplaceholder new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/deploy/pynspect/setup.py b/deploy/pynspect/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..7bfecee39679761eee9446a8f5ede8c4e0eaa78f --- /dev/null +++ b/deploy/pynspect/setup.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +#------------------------------------------------------------------------------- +# Copyright (c) since 2016, CESNET, z. s. p. o. +# Authors: Jan Mach <jan.mach@cesnet.cz> +# Pavel Kácha <pavel.kacha@cesnet.cz> +# Use of this source is governed by an ISC license, see LICENSE file. +#------------------------------------------------------------------------------- + +# Resources: +# https://packaging.python.org/distributing/ +# http://python-packaging-user-guide.readthedocs.io/distributing/ + +# Always prefer setuptools over distutils +from setuptools import setup, find_packages +# To use a consistent encoding +from codecs import open +from os import path + +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 = 'pynspect', + version = '0.3', + description = 'Python 3 library for filtering, querying or inspecting almost arbitrary data structures.', + long_description = long_description, + classifiers = [ + 'Development Status :: 3 - Alpha', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3 :: Only' + ], + keywords = 'library', + url = 'https://homeproj.cesnet.cz/git/mentat-ng.git', + author = 'Jan Mach', + author_email = 'jan.mach@cesnet.cz', + license = 'MIT', + packages = ['pynspect'], + test_suite = 'nose.collector', + tests_require = [ + 'nose' + ], + install_requires=[ + 'ipranges' + ], + zip_safe = True +) diff --git a/lib/pynspect/__init__.py b/lib/pynspect/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f04b228f73878c52d39d43cbb1e92857c28ca5c1 100644 --- a/lib/pynspect/__init__.py +++ b/lib/pynspect/__init__.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#------------------------------------------------------------------------------- +# This file is part of Mentat system (https://mentat.cesnet.cz/). +# +# Copyright (C) since 2011 CESNET, z.s.p.o (http://www.ces.net/) +# Use of this source is governed by the MIT license, see LICENSE file. +#------------------------------------------------------------------------------- + +__version__ = "0.3" diff --git a/lib/pynspect/filters.py b/lib/pynspect/filters.py index ef85ffa149065b7c598587085af5ec878687eb8a..05d4de97fc039717c188041ceb848618d292ec48 100644 --- a/lib/pynspect/filters.py +++ b/lib/pynspect/filters.py @@ -51,7 +51,7 @@ There are two main tools in this package: """ -__version__ = "0.1" +__version__ = "0.3" __author__ = "Jan Mach <jan.mach@cesnet.cz>" __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>" diff --git a/lib/pynspect/gparser.py b/lib/pynspect/gparser.py index 27b9a60c062a5c2d3d70ef6e4a98929cba2e46a5..a253b9fca13afa8691828439260e1f5696c356e4 100644 --- a/lib/pynspect/gparser.py +++ b/lib/pynspect/gparser.py @@ -115,7 +115,7 @@ Currently implemented grammar """ -__version__ = "0.1" +__version__ = "0.3" __author__ = "Jan Mach <jan.mach@cesnet.cz>" __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>" diff --git a/lib/pynspect/jpath.py b/lib/pynspect/jpath.py index 91d44d516ec12f34b49b2224f969c09074f4f6b5..814f58568177591dee5793183923ab0075c84ddd 100644 --- a/lib/pynspect/jpath.py +++ b/lib/pynspect/jpath.py @@ -122,7 +122,7 @@ The current implementation has following known drawbacks: """ -__version__ = "0.1" +__version__ = "0.3" __author__ = "Jan Mach <jan.mach@cesnet.cz>" __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>" diff --git a/lib/pynspect/lexer.py b/lib/pynspect/lexer.py index cc11fda5de1324d0070f8c127e491c349b132997..52321d05570552410359ceb1d7e49dd8b5582f4f 100644 --- a/lib/pynspect/lexer.py +++ b/lib/pynspect/lexer.py @@ -79,7 +79,7 @@ Currently recognized tokens """ -__version__ = "0.1" +__version__ = "0.3" __author__ = "Jan Mach <jan.mach@cesnet.cz>" __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>" diff --git a/lib/pynspect/rules.py b/lib/pynspect/rules.py index 0f85314f44cc9da5eeed62b27223c0a491955bbc..4a9c665202763ab0262b56081c896d6a0111e9be 100644 --- a/lib/pynspect/rules.py +++ b/lib/pynspect/rules.py @@ -96,7 +96,7 @@ Rule evaluation """ -__version__ = "0.1" +__version__ = "0.3" __author__ = "Jan Mach <jan.mach@cesnet.cz>" __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea.kropacova@cesnet.cz>"