[Git][debian-gis-team/usgs][master] 9 commits: Update d/watch
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Sun Aug 10 18:06:43 BST 2025
Antonio Valentino pushed to branch master at Debian GIS Project / usgs
Commits:
a2a495bf by Antonio Valentino at 2025-08-09T10:56:02+00:00
Update d/watch
- - - - -
4ddef38e by Antonio Valentino at 2025-08-09T14:19:38+00:00
New upstream version 0.3.6
- - - - -
7a698e40 by Antonio Valentino at 2025-08-09T14:19:39+00:00
Update upstream source from tag 'upstream/0.3.6'
Update to upstream version '0.3.6'
with Debian dir d8d88bb6de4729d8a21e13b92e47fe7b3296c781
- - - - -
bdd73277 by Antonio Valentino at 2025-08-09T14:21:21+00:00
New upstream release
- - - - -
4bf5e4d6 by Antonio Valentino at 2025-08-09T14:23:32+00:00
Drop 0002-Fix-license-in-the-setup-script.patch
- - - - -
e97ec580 by Antonio Valentino at 2025-08-09T14:24:33+00:00
Update dates in d/copyright
- - - - -
1da78f7c by Antonio Valentino at 2025-08-09T14:26:45+00:00
Drop dependency on python3-mock
- - - - -
1366fc00 by Antonio Valentino at 2025-08-09T14:28:01+00:00
Mark python-usgs-doc as Multi-Arch: foreign
- - - - -
a3ae4f7f by Antonio Valentino at 2025-08-09T14:30:40+00:00
Set distribution to unstable
- - - - -
24 changed files:
- − PKG-INFO
- debian/changelog
- debian/control
- debian/copyright
- − debian/patches/0002-Fix-license-in-the-setup-script.patch
- debian/patches/series
- debian/watch
- requirements.txt
- setup.cfg
- setup.py
- tests/create_snapshots.py
- tests/test_api.py
- tests/test_payloads.py
- − usgs.egg-info/PKG-INFO
- − usgs.egg-info/SOURCES.txt
- − usgs.egg-info/dependency_links.txt
- − usgs.egg-info/entry_points.txt
- − usgs.egg-info/not-zip-safe
- − usgs.egg-info/requires.txt
- − usgs.egg-info/top_level.txt
- usgs/__init__.py
- usgs/api.py
- usgs/payloads.py
- usgs/scripts/cli.py
Changes:
=====================================
PKG-INFO deleted
=====================================
@@ -1,10 +0,0 @@
-Metadata-Version: 2.1
-Name: usgs
-Version: 0.3.5
-Summary: Access the USGS inventory service
-Home-page: https://github.com/kapadia/usgs
-Author: Amit Kapadia
-Author-email: amit at planet.com
-License: MIT
-Provides-Extra: test
-License-File: LICENSE
=====================================
debian/changelog
=====================================
@@ -1,9 +1,20 @@
-usgs (0.3.5-4) UNRELEASED; urgency=medium
+usgs (0.3.6-1) unstable; urgency=medium
- * Team upload.
+ [ Bas Couwenberg ]
* Bump Standards-Version to 4.7.2, no changes.
- -- Bas Couwenberg <sebastic at debian.org> Sun, 28 Jul 2024 20:06:26 +0200
+ [ Antonio Valentino ]
+ * New upstream release.
+ * Update d/watch file (use GitHub instead of PyPi).
+ * debian/patches:
+ - Drop 0002-Fix-license-in-the-setup-script.patch.
+ applied upstream.
+ * Update dates in d/copyright.
+ * debian/conrol:
+ - Drop dependency on python3-mock.
+ - Mark python-usgs-doc as Multi-Arch: foreign.
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it> Sat, 09 Aug 2025 14:28:15 +0000
usgs (0.3.5-3) unstable; urgency=medium
=====================================
debian/control
=====================================
@@ -9,7 +9,6 @@ Build-Depends: debhelper-compat (= 13),
dh-sequence-sphinxdoc <!nodoc>,
python3-all,
python3-click,
- python3-mock <!nocheck>,
python3-pytest <!nocheck>,
python3-requests,
python3-requests-futures,
@@ -40,6 +39,7 @@ Suggests: python-usgs-doc
Package: python-usgs-doc
Section: doc
Architecture: all
+Multi-Arch: foreign
Depends: ${misc:Depends},
${sphinxdoc:Depends}
Suggests: www-browser
=====================================
debian/copyright
=====================================
@@ -8,7 +8,7 @@ Copyright: 2017, Amit Kapadia <amit at planet.com>
License: ISC
Files: debian/*
-Copyright: 2023, Antonio Valentino <antonio.valentino at tiscali.it>
+Copyright: 2023-2025, Antonio Valentino <antonio.valentino at tiscali.it>
License: ISC
License: ISC
=====================================
debian/patches/0002-Fix-license-in-the-setup-script.patch deleted
=====================================
@@ -1,22 +0,0 @@
-From: Antonio Valentino <antonio.valentino at tiscali.it>
-Date: Sat, 8 Jul 2023 16:54:19 +0000
-Subject: Fix license in the setup script
-
-Forwarded: https://github.com/kapadia/usgs/pull/72
----
- setup.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index c839d12..2fc430b 100644
---- a/setup.py
-+++ b/setup.py
-@@ -19,7 +19,7 @@ setup(name='usgs',
- author=u"Amit Kapadia",
- author_email='amit at planet.com',
- url='https://github.com/kapadia/usgs',
-- license='MIT',
-+ license='ISC',
- packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
- include_package_data=True,
- package_data={'usgs': ['data/datasets.json']},
=====================================
debian/patches/series
=====================================
@@ -1,2 +1 @@
0001-Fix-privacy-breach.patch
-0002-Fix-license-in-the-setup-script.patch
=====================================
debian/watch
=====================================
@@ -4,4 +4,5 @@ pgpmode=none,\
dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$//,\
uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|c|beta|b|alpha|a)\d*)$/$1~$2/;s/RC/rc/;s/\-/\./g,\
filenamemangle=s/(?:.*?)?(?:rel|v|@PACKAGE@)?[\-\_]?(\d\S*)\.(tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))/@PACKAGE at -$1.$2/ \
-https://pypi.debian.net/@PACKAGE@/@PACKAGE@-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
+https://github.com/kapadia/usgs/tags \
+(?:.*?/archive/(?:.*?/)?)?(?:rel|v|@PACKAGE@)?[\-\_]?(\d\S*)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
=====================================
requirements.txt
=====================================
@@ -1,4 +1,3 @@
-mock==1.3.0
pytest==2.8.7
click>=4.0
requests>=2.7.0
=====================================
setup.cfg
=====================================
@@ -1,7 +1,2 @@
[upload]
-dry-run = 0
-
-[egg_info]
-tag_build =
-tag_date = 0
-
+dry-run = 0
\ No newline at end of file
=====================================
setup.py
=====================================
@@ -19,7 +19,7 @@ setup(name='usgs',
author=u"Amit Kapadia",
author_email='amit at planet.com',
url='https://github.com/kapadia/usgs',
- license='MIT',
+ license='ISC',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
package_data={'usgs': ['data/datasets.json']},
@@ -30,7 +30,7 @@ setup(name='usgs',
'requests_futures>=0.9.5'
],
extras_require={
- 'test': ['pytest', 'mock'],
+ 'test': ['pytest'],
},
entry_points="""
[console_scripts]
=====================================
tests/create_snapshots.py
=====================================
@@ -17,7 +17,7 @@ def create_snapshots():
Run requests against USGS API for use in tests.
"""
- api_key = api.login(os.environ['USGS_USERNAME'], os.environ['USGS_PASSWORD'])
+ api_key = api.login(os.environ['USGS_USERNAME'], os.environ['USGS_TOKEN'])
# Dataset Fields
response = api.dataset_fields("LANDSAT_8_C1", "EE", api_key=api_key)
=====================================
tests/test_api.py
=====================================
@@ -1,5 +1,5 @@
import pytest
-import mock
+from unittest import mock
from usgs import api
from .MockPost import MockPost
@@ -110,4 +110,4 @@ def test_scene_search():
assert len(response['data']["results"]) == 1
for expected_key in expected_keys:
- assert expected_key in response['data']["results"][0]
\ No newline at end of file
+ assert expected_key in response['data']["results"][0]
=====================================
tests/test_payloads.py
=====================================
@@ -54,8 +54,8 @@ class PayloadsTest(unittest.TestCase):
def test_login(self):
- expected = """{"username": "username", "password": "password"}"""
- payload = payloads.login("username", "password")
+ expected = """{"username": "username", "token": "token"}"""
+ payload = payloads.login("username", "token")
assert compare_json(payload, expected)
=====================================
usgs.egg-info/PKG-INFO deleted
=====================================
@@ -1,10 +0,0 @@
-Metadata-Version: 2.1
-Name: usgs
-Version: 0.3.5
-Summary: Access the USGS inventory service
-Home-page: https://github.com/kapadia/usgs
-Author: Amit Kapadia
-Author-email: amit at planet.com
-License: MIT
-Provides-Extra: test
-License-File: LICENSE
=====================================
usgs.egg-info/SOURCES.txt deleted
=====================================
@@ -1,45 +0,0 @@
-.gitignore
-.travis.yml
-LICENSE
-README.rst
-requirements.txt
-setup.cfg
-setup.py
-docs/Makefile
-docs/conf.py
-docs/index.rst
-docs/reference/api.rst
-docs/reference/cli.rst
-docs/reference/payloads.rst
-docs/reference/catalog/cwic.rst
-docs/reference/catalog/ee.rst
-docs/reference/catalog/hdds.rst
-docs/reference/catalog/lpcs.rst
-scripts/get_datasets_in_node.py
-tests/MockPost.py
-tests/__init__.py
-tests/create_snapshots.py
-tests/test_api.py
-tests/test_cli.py
-tests/test_payloads.py
-tests/data/dataset-download-options.json
-tests/data/dataset-fields.json
-tests/data/dataset-search.json
-tests/data/download-options.json
-tests/data/download-request.json
-tests/data/scene-metadata.json
-tests/data/scene-search.json
-usgs/__init__.py
-usgs/api.py
-usgs/payloads.py
-usgs/xsi.py
-usgs.egg-info/PKG-INFO
-usgs.egg-info/SOURCES.txt
-usgs.egg-info/dependency_links.txt
-usgs.egg-info/entry_points.txt
-usgs.egg-info/not-zip-safe
-usgs.egg-info/requires.txt
-usgs.egg-info/top_level.txt
-usgs/data/datasets.json
-usgs/scripts/__init__.py
-usgs/scripts/cli.py
\ No newline at end of file
=====================================
usgs.egg-info/dependency_links.txt deleted
=====================================
@@ -1 +0,0 @@
-
=====================================
usgs.egg-info/entry_points.txt deleted
=====================================
@@ -1,2 +0,0 @@
-[console_scripts]
-usgs = usgs.scripts.cli:usgs
=====================================
usgs.egg-info/not-zip-safe deleted
=====================================
@@ -1 +0,0 @@
-
=====================================
usgs.egg-info/requires.txt deleted
=====================================
@@ -1,7 +0,0 @@
-click>=4.0
-requests>=2.7.0
-requests_futures>=0.9.5
-
-[test]
-pytest
-mock
=====================================
usgs.egg-info/top_level.txt deleted
=====================================
@@ -1 +0,0 @@
-usgs
=====================================
usgs/__init__.py
=====================================
@@ -1,5 +1,4 @@
-
-__version__ = "0.3.5"
+__version__ = "0.3.6"
# The USGS API endpoint
USGS_API_DEPRECATED = "https://earthexplorer.usgs.gov/inventory/json/v/1.4.0"
@@ -17,17 +16,22 @@ EARTH_EXPLORER_CATALOG_NODE = "EE"
# http://hddsexplorer.usgs.gov/
HDDS_EXPLORER_CATALOG_NODE = "HDDS"
+
class USGSError(Exception):
pass
+
class USGSApiKeyRequiredError(Exception):
pass
+
class USGSAmbiguousNode(Exception):
pass
+
class USGSDependencyRequired(ImportError):
pass
+
class USGSAuthExpiredError(Exception):
pass
=====================================
usgs/api.py
=====================================
@@ -136,19 +136,19 @@ def dataset_search(dataset=None, catalog=None, ll=None, ur=None, start_date=None
return response
-def login(username, password, save=True):
+def login(username, token, save=True):
"""
Log in, creating a temporary API key and optionally storing it for later use.
:param str username: Username of the USGS account to log in with.
- :param str password: Password of the USGS account to log in with.
+ :param str token: Application Token of the USGS account to log in with.
:param bool save: If true, the API key will be stored in a local file (~/.usgs)
until `api.logout` is called to remove it. The stored key will be used by
other functions to authenticate requests whenever an API key is not explicitly
provided.
"""
- url = '{}/login'.format(USGS_API)
- payload = payloads.login(username, password)
+ url = '{}/login-token'.format(USGS_API)
+ payload = payloads.login(username, token)
with _create_session(api_key=None) as session:
created = datetime.now().isoformat()
=====================================
usgs/payloads.py
=====================================
@@ -124,18 +124,18 @@ def dataset_search(dataset, catalog, start_date=None, end_date=None, ll=None, ur
return json.dumps(payload)
-def login(username, password):
+def login(username, token):
"""
Upon a successful login, an API key will be returned. This key will be active
for two hours and should be destroyed upon final use of the service by calling
the logout method.
:param str username:
- :param str password:
+ :param str token:
"""
payload = {
"username": username,
- "password": password
+ "token": token
}
return json.dumps(payload)
=====================================
usgs/scripts/cli.py
=====================================
@@ -84,8 +84,8 @@ def usgs():
@click.command()
@click.argument("username", envvar='USGS_USERNAME')
- at click.argument("password", envvar='USGS_PASSWORD')
-def cycle_token(username, password):
+ at click.argument("token", envvar='USGS_TOKEN')
+def cycle_token(username, token):
credential_filepath = os.path.join(os.path.expanduser("~"), ".usgs")
with open(credential_filepath) as f:
@@ -97,7 +97,7 @@ def cycle_token(username, password):
click.echo('The token lifetime is {} seconds'.format(token_lifetime))
if token_lifetime > approx_two_hours:
api.logout()
- api.login(username, password)
+ api.login(username, token)
@click.command()
@@ -139,9 +139,9 @@ def download_request(dataset, entity_id, product_id, api_key):
@click.command()
@click.argument("username", envvar='USGS_USERNAME')
- at click.argument("password", envvar='USGS_PASSWORD')
-def login(username, password):
- click.echo(api.login(username, password))
+ at click.argument("token", envvar='USGS_TOKEN')
+def login(username, token):
+ click.echo(api.login(username, token))
@click.command()
View it on GitLab: https://salsa.debian.org/debian-gis-team/usgs/-/compare/7c769fa64974aa50fba976d8902e294af45f40ac...a3ae4f7fa42c0961baf764c5e468deca72f5ed18
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/usgs/-/compare/7c769fa64974aa50fba976d8902e294af45f40ac...a3ae4f7fa42c0961baf764c5e468deca72f5ed18
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250810/41984f6e/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list