From 26ab13f7df8d481ccf38c751edfda3eb4e922d3f Mon Sep 17 00:00:00 2001 From: Bryant Chow Date: Thu, 8 Dec 2022 11:46:19 -0900 Subject: [PATCH 1/2] replaced old-school setup.py with new-school pyproject.toml file, removed ununsed environment.yaml file which may be replaced later when Conda install is attempted --- environment.yml | 7 ------- pyproject.toml | 39 +++++++++++++++++++++++++++++++++++++++ setup.py | 25 ------------------------- 3 files changed, 39 insertions(+), 32 deletions(-) delete mode 100644 environment.yml create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 51de15c..0000000 --- a/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: pysep -channels: - - conda-forge - - defaults -dependencies: - - obspy - - cartopy diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..700fadb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +requires = ["setuptools>=61.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "PySEP" +description = "Python Seismogram Extraction and Processing" +readme = "README.md" +requires-python = ">=3.7" +license = "MIT" +version = "0.2.0" +authors = [ + {name = "adjTomo Dev Team"}, + {email = "adjtomo@gmail.com"} +] +maintainers = [ + {name = "Bryant Chow", + email = "bhchow@alaska.edu"} +] +dependencies = [ + "obspy", + "cartopy", + "pyyaml", + "llnl_db_client @ git+https://github.com/krischer/llnl_db_client.git" +] + +[project.optional-dependencies] +test = [ + "pytest", +] + +[project.urls] +homepage = "https://github.com/adjtomo/" +documentation = "https://github.com/adjtomo/pysep/wiki" +repository = "https://github.com/adjtomo/pysep" + +[project.scripts] +pysep = "pysep.pysep:main" +recsec = "pysep.recsec.main" diff --git a/setup.py b/setup.py deleted file mode 100644 index 7a73e7d..0000000 --- a/setup.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -from setuptools import setup, find_packages - - -install_requires = [ - "obspy>=1.2.2", - "cartopy>=0.20.2", - "pyyaml>=5.4", - "llnl_db_client @ git+https://github.com/krischer/llnl_db_client.git", - ] - -setup(name="pysep", - version='0.2.0', - description="Python Seismogram Extraction and Processing", - url="http://github.com/adjtomo/pysep", - author='adjTomo Dev Team', - license='GPL-3.0', - python_requires=">=3.7", - packages=find_packages(), - install_requires=install_requires, - entry_points={"console_scripts": ["pysep=pysep.pysep:main", - "recsec=pysep.recsec:main"] - }, - zip_safe=False - ) From 83d8bd98389005f35ecff03b0c581c181751a6df Mon Sep 17 00:00:00 2001 From: Bryant Chow Date: Thu, 8 Dec 2022 12:23:16 -0900 Subject: [PATCH 2/2] direct pip install will not work due to some dependency errors with cartopy and GEOS but .toml file still valid. added conda-required environment.yaml file which will be used to do the entire install procedure --- environment.yml | 13 +++++++++++++ pyproject.toml | 17 ++++++----------- pysep/recsec.py | 2 +- requirements.txt | 5 ----- 4 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 environment.yml delete mode 100644 requirements.txt diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..c8d4f9e --- /dev/null +++ b/environment.yml @@ -0,0 +1,13 @@ +name: pysep +channels: + - conda-forge + - defaults +dependencies: + - pip + - obspy + - cartopy + - pyyaml + - pip: + - git+https://github.com/krischer/llnl_db_client.git + - -e . + diff --git a/pyproject.toml b/pyproject.toml index 700fadb..b6e7f10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,20 +3,16 @@ requires = ["setuptools>=61.0.0", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "PySEP" +name = "pysep" +version = "0.2.0" description = "Python Seismogram Extraction and Processing" readme = "README.md" requires-python = ">=3.7" -license = "MIT" -version = "0.2.0" +license = {file = "LICENSE.txt"} authors = [ {name = "adjTomo Dev Team"}, {email = "adjtomo@gmail.com"} ] -maintainers = [ - {name = "Bryant Chow", - email = "bhchow@alaska.edu"} -] dependencies = [ "obspy", "cartopy", @@ -25,9 +21,8 @@ dependencies = [ ] [project.optional-dependencies] -test = [ - "pytest", -] +test = ["pytest"] +dev = ["pytest", "ipython", "ipdb"] [project.urls] homepage = "https://github.com/adjtomo/" @@ -36,4 +31,4 @@ repository = "https://github.com/adjtomo/pysep" [project.scripts] pysep = "pysep.pysep:main" -recsec = "pysep.recsec.main" +recsec = "pysep.recsec:main" diff --git a/pysep/recsec.py b/pysep/recsec.py index a5ff5b5..bef2a11 100755 --- a/pysep/recsec.py +++ b/pysep/recsec.py @@ -1887,7 +1887,7 @@ def parse_args(): """ parser = argparse.ArgumentParser( description="Input basic record section params", - formatter_class=argparse.RawTextHelpFormatter, + # formatter_class=argparse.RawTextHelpFormatter, ) parser.add_argument("-p", "--pysep_path", default="./", type=str, nargs="?", diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3723eca..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -obspy>=1.2.2 -pyyaml>=5.4 -cartopy>=0.20.2 -pytest>=7.1.2 -pandas>=1.4.2