diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index b262255e1da62b498a111fdf7990ac7c80c4afdb..16719dfede27de79474f3df8b2789d9a5b4f59cc 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -100,7 +100,7 @@ Tips ---- To run a subset of tests:: - $ python -m unittest tests.test_data2passcal + $ python -m pytest tests/test_data2passcal.py Deploying --------- diff --git a/HISTORY.rst b/HISTORY.rst index d35c92df96d952c9a569f2e4cdf40715dd450ed9..6880f3037c43b84ac95ed98f96cc9f384073ef0b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -25,3 +25,18 @@ History * Updated list of platform specific dependencies to be installed when installing data2passcal (see setup.py) * Installed and tested data2passcal against Python2.7 and Python3.6 using tox * Formatted Python code to conform to the PEP8 style guide (exception: E722, E712, E501) + +2020.114 (2020-04-23) +------------------ +* Created conda packages for "data2passcal" that can run on Python2.7 and Python3.6 +=> To create package: + - clone the "data2passcal" repo + - "cd" in "data2passcal" directory + - run "conda-build ." +=> To install locally with dependencies: + - run "conda install -c ${CONDA_PREFIX}/conda-bld/ data2passcal" +=> To install on user's computer from tarball with all dependencies: + - download tarball and "cd" to directory where tarball was downloaded + - run "conda install ./data2passcal-2020.114-py*_0.tar.bz2" + (choose appropriate python version for your platform) + - run "conda update data2passcal" diff --git a/MANIFEST.in b/MANIFEST.in index 965b2dda7db7c49f68857dc3aea9af37e30a745e..ced9d127ece3b0481c36a07ff0a66b3dbd705cfe 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,5 @@ include LICENSE include README.rst recursive-include tests * -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] -recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif +recursive-include docs *.rst conf.py Makefile make.bat diff --git a/conda.recipe/build.bat b/conda.recipe/build.bat new file mode 100644 index 0000000000000000000000000000000000000000..ae8549e463765a02143a5c82cbe8ef15d3295cef --- /dev/null +++ b/conda.recipe/build.bat @@ -0,0 +1,4 @@ +"%PYTHON%" data2passcal\config.py +move config.ini data2passcal +"%PYTHON%" setup.py install --single-version-externally-managed --record=record.txt +if errorlevel 1 exit 1 diff --git a/conda.recipe/build.sh b/conda.recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..e871f87215dabfa304de49779f83db680c0bc7c8 --- /dev/null +++ b/conda.recipe/build.sh @@ -0,0 +1,3 @@ +$PYTHON data2passcal/config.py +mv config.ini data2passcal +$PYTHON setup.py install --single-version-externally-managed --record=record.txt diff --git a/conda.recipe/conda_build_config.yaml b/conda.recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b0e3e7797a0e50b86ac0203fdbd89c201eb3a12a --- /dev/null +++ b/conda.recipe/conda_build_config.yaml @@ -0,0 +1,4 @@ +python: + - 2.7 + - 3.6 +target_platform: osx-64 diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 260432777941989967c8ee02178c86241ee4d03c..dd0ca97a5ca29b30fce7fb9d9e5f1e880c027b9f 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -1,24 +1,37 @@ package: name: data2passcal - version: 2014.125 + version: 2020.114 source: - path: .. + path: ../ build: - # If the installation is complex, or different between Unix and Windows, use - # separate bld.bat and build.sh files instead of this key. Add the line - # "skip: True # [py<35]" (for example) to limit to Python 3.5 and newer, or - # "skip: True # [not win]" to limit to Windows. - script: python setup.py install --single-version-externally-managed --record=record.txt + number: 0 + entry_points: + - data2passcal = data2passcal.data2passcal:main requirements: - build: + host: - python - setuptools + - configparser # [py<32] run: - python + - configparser # [py<32] + +test: + requires: + - mock # [py<33] + - pytest + source_files: + - data2passcal/config.ini + - tests + commands: + - python -c "import data2passcal.data2passcal; print(data2passcal.__version__)" + - pytest about: home: https://git.passcal.nmt.edu/passoft/data2passcal - summary: Prepare SEED data for shipment to PASSCAL. + license: GPLv3 + license_file: LICENSE + summary: Send MSEED files ready for archival at the DMC to PASSCAL's QC system diff --git a/data2passcal/__init__.py b/data2passcal/__init__.py index 8f21cef6e0f1a9f038e49585d5d448812b2883df..3a08473ed7ec7352ef5ec141b7749c18bb91002b 100644 --- a/data2passcal/__init__.py +++ b/data2passcal/__init__.py @@ -4,4 +4,4 @@ __author__ = """IRIS PASSCAL""" __email__ = 'software-support@passcal.nmt.edu' -__version__ = '2020.107' +__version__ = '2020.114' diff --git a/data2passcal/data2passcal.py b/data2passcal/data2passcal.py index 7cb855196ee6f11a189b0478270d8815548fbd6d..c2fcf3b60f1f17a11270fbf35cd82d2df87943c9 100644 --- a/data2passcal/data2passcal.py +++ b/data2passcal/data2passcal.py @@ -19,7 +19,7 @@ import struct import sys from time import sleep, time -VERSION = '2020.107' +VERSION = '2020.114' # Cache the ftplib.FTP class so it will be available to test_FTP(FTP) when calling isinstance assert @@ -27,7 +27,7 @@ FTPCache = ftplib.FTP # Parse configuration file config = configparser.ConfigParser() -print(config.read('data2passcal/config.ini')) +config.read(os.path.dirname(os.path.realpath(__file__)) + '/config.ini') # TEST related diff --git a/setup.cfg b/setup.cfg index a6afa20c057127edbc8738bc2805b6bb1c8c5fc7..379997ac164d680ab7b7db737261a1d12e2e1456 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2020.107 +current_version = 2020.114 commit = True tag = True diff --git a/setup.py b/setup.py index 9f29d0f7b3af75df852fe0cc018c63e905075029..f546a428b78bfbc0403d98e85257e23de435eb0d 100644 --- a/setup.py +++ b/setup.py @@ -51,11 +51,11 @@ setup( license="GNU General Public License v3", long_description=readme + '\n\n' + history, include_package_data=True, + package_data={'data2passcal': ['config.ini']}, keywords='data2passcal', name='data2passcal', packages=find_packages(include=['data2passcal']), - test_suite='tests', url='https://git.passcal.nmt.edu/passoft/data2passcal', - version='2020.107', + version='2020.114', zip_safe=False, ) diff --git a/tests/test_data2passcal.py b/tests/test_data2passcal.py index 02d5c3319849c78c498560163d2000e8f4fd3a57..fbef0be3504b68fba4d758e81429e3b7f9673280 100644 --- a/tests/test_data2passcal.py +++ b/tests/test_data2passcal.py @@ -12,7 +12,7 @@ import unittest from data2passcal.data2passcal import get_FTP, ismseed, scan_dir, send2passcal -VERSION = '2020.107' +VERSION = '2020.114' try: