| OLD | NEW |
| 1 # Copyright 2014 Google Inc. All rights reserved. | 1 # Copyright 2014 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); you may not | 3 # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 # use this file except in compliance with the License. You may obtain a copy of | 4 # use this file except in compliance with the License. You may obtain a copy of |
| 5 # the License at | 5 # the License at |
| 6 # | 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # | 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | 11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 # License for the specific language governing permissions and limitations under | 12 # License for the specific language governing permissions and limitations under |
| 13 # the License. | 13 # the License. |
| 14 | 14 |
| 15 """This module installs the pyaff4 library.""" | 15 """This module installs the pyaff4 library.""" |
| 16 import _version | |
| 17 | 16 |
| 18 from setuptools import setup | 17 from setuptools import setup |
| 19 from setuptools.command.test import test as TestCommand | 18 from setuptools.command.test import test as TestCommand |
| 20 | 19 |
| 21 try: | 20 try: |
| 22 with open('../README.md') as file: | 21 with open('../README.md') as file: |
| 23 long_description = file.read() | 22 long_description = file.read() |
| 24 except IOError: | 23 except IOError: |
| 25 long_description = "" | 24 long_description = "" |
| 26 | 25 |
| 26 ENV = {"__file__": __file__} |
| 27 exec open("pyaff4/_version.py").read() in ENV |
| 28 VERSION = ENV["get_versions"]() |
| 29 |
| 27 | 30 |
| 28 class NoseTestCommand(TestCommand): | 31 class NoseTestCommand(TestCommand): |
| 29 def finalize_options(self): | 32 def finalize_options(self): |
| 30 TestCommand.finalize_options(self) | 33 TestCommand.finalize_options(self) |
| 31 self.test_args = [] | 34 self.test_args = [] |
| 32 self.test_suite = True | 35 self.test_suite = True |
| 33 | 36 |
| 34 def run_tests(self): | 37 def run_tests(self): |
| 35 # Run nose ensuring that argv simulates running nosetests directly | 38 # Run nose ensuring that argv simulates running nosetests directly |
| 36 import nose | 39 import nose |
| 37 nose.run_exit(argv=['nosetests']) | 40 nose.run_exit(argv=['nosetests']) |
| 38 | 41 |
| 39 | 42 |
| 40 commands = {} | 43 commands = {} |
| 41 commands["test"] = NoseTestCommand | 44 commands["test"] = NoseTestCommand |
| 42 | 45 |
| 43 setup( | 46 setup( |
| 44 name='pyaff4', | 47 name='pyaff4', |
| 45 long_description=long_description, | 48 long_description=long_description, |
| 46 version=_version.get_versions()["pep440"], | 49 version=VERSION["pep440"], |
| 47 cmdclass=commands, | 50 cmdclass=commands, |
| 48 description='Python Advanced Forensic Format Version 4 library.', | 51 description='Python Advanced Forensic Format Version 4 library.', |
| 49 author='Michael Cohen', | 52 author='Michael Cohen', |
| 50 author_email='scudette@gmail.com', | 53 author_email='scudette@gmail.com', |
| 51 url='https://www.aff4.org/', | 54 url='https://www.aff4.org/', |
| 52 packages=['pyaff4'], | 55 packages=['pyaff4'], |
| 53 package_dir={"pyaff4": "pyaff4"}, | 56 package_dir={"pyaff4": "pyaff4"}, |
| 54 install_requires=[ | 57 install_requires=[ |
| 55 "aff4-snappy == 0.5", | 58 "aff4-snappy == 0.5", |
| 56 "rdflib == 4.2.1", | 59 "rdflib == 4.2.1", |
| 57 "intervaltree == 2.1.0", | 60 "intervaltree == 2.1.0", |
| 58 ], | 61 ], |
| 59 extras_require=dict( | 62 extras_require=dict( |
| 60 cloud="google-api-python-client" | 63 cloud="google-api-python-client" |
| 61 ) | 64 ) |
| 62 ) | 65 ) |
| OLD | NEW |