Skip to content

Commit

Permalink
Merge pull request #2 from umr-lops/fix_lib_name
Browse files Browse the repository at this point in the history
fix the package name to enable `import safe_asar`
  • Loading branch information
agrouaze authored Jul 25, 2024
2 parents 0b40829 + ebf4efc commit 25df817
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 32 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ If you are proposing a feature:
Get Started!
------------

Ready to contribute? Here's how to set up `safe_asar` for local development.
Ready to contribute? Here's how to set up `n1_asar` for local development.

1. Fork the `safe_asar` repo on GitHub.
1. Fork the `n1_asar` repo on GitHub.
2. Clone your fork locally::

$ git clone git@github.com:your_name_here/safe_asar.git
$ git clone git@github.com:your_name_here/n1_asar.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv safe_asar
$ cd safe_asar/
$ mkvirtualenv n1_asar
$ cd n1_asar/
$ python setup.py develop

4. Create a branch for local development::
Expand Down Expand Up @@ -100,7 +100,7 @@ Tips

To run a subset of tests::

$ pytest tests.test_safe_asar
$ pytest tests.test_n1_asar


Deploying
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache

lint/flake8: ## check style with flake8
flake8 safe_asar tests
flake8 n1_asar tests


lint: lint/flake8 ## check style
Expand All @@ -61,15 +61,15 @@ test-all: ## run tests on every Python version with tox
tox

coverage: ## check code coverage quickly with the default Python
coverage run --source safe_asar -m pytest
coverage run --source n1_asar -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/safe_asar.rst
rm -f docs/n1_asar.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ safe_asar
sphinx-apidoc -o docs/ n1_asar
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = safe_asar
SPHINXPROJ = n1_asar
SOURCEDIR = .
BUILDDIR = _build

Expand Down
18 changes: 9 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# safe_asar documentation build configuration file, created by
# n1_asar documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -21,7 +21,7 @@
import sys
sys.path.insert(0, os.path.abspath('..'))

import safe_asar
import n1_asar

# -- General configuration ---------------------------------------------

Expand Down Expand Up @@ -55,9 +55,9 @@
# the built documents.
#
# The short X.Y version.
version = safe_asar.__version__
version = n1_asar.__version__
# The full version, including alpha/beta/rc tags.
release = safe_asar.__version__
release = n1_asar.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -100,7 +100,7 @@
# -- Options for HTMLHelp output ---------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'safe_asardoc'
htmlhelp_basename = 'n1_asardoc'


# -- Options for LaTeX output ------------------------------------------
Expand All @@ -127,7 +127,7 @@
# (source start file, target name, title, author, documentclass
# [howto, manual, or own class]).
latex_documents = [
(master_doc, 'safe_asar.tex',
(master_doc, 'n1_asar.tex',
'xarray-safe-asar Documentation',
'Antoine GROUAZEL', 'manual'),
]
Expand All @@ -138,7 +138,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'safe_asar',
(master_doc, 'n1_asar',
'xarray-safe-asar Documentation',
[author], 1)
]
Expand All @@ -150,10 +150,10 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'safe_asar',
(master_doc, 'n1_asar',
'xarray-safe-asar Documentation',
author,
'safe_asar',
'n1_asar',
'One line description of project.',
'Miscellaneous'),
]
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To install xarray-safe-asar, run this command in your terminal:

.. code-block:: console
$ pip install safe_asar
$ pip install n1_asar
This is the preferred method to install xarray-safe-asar, as it will always install the most recent stable release.

Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=safe_asar
set SPHINXPROJ=n1_asar

if "%1" == "" goto help

Expand Down
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Usage

To use xarray-safe-asar in a project::

import safe_asar
import n1_asar
File renamed without changes.
36 changes: 31 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "xarray-safe-asar"
version = "2024.07.04"
description = "Python lib to read ASAR SLC product from ENVISAT mission (2002-2012)."
readme = "README.rst"
readme = "README.md"
authors = [
{name = "Antoine GROUAZEL", email = "antoine.grouazel@ifremer.fr"}
]
maintainers = [
{name = "Antoine GROUAZEL", email = "antoine.grouazel@ifremer.fr"}
]
keywords = [
"xarray",
"earth-observation",
"remote-sensing",
"satellite-imagery",
"asar",
"envisat",
"sar",
"synthetic-aperture-radar",
]
classifiers = [

"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
]
dynamic = ["version"]
license = {text = "MIT license"}
dependencies = [
'xarray'
Expand All @@ -37,12 +54,20 @@ changelog = "https://github.com/umr-lops/xarray-safe-asar/blob/master/changelog.
homepage = "https://github.com/umr-lops/xarray-safe-asar"

[tool.setuptools]
package-dir = {"" = "src"}
packages = ["n1_asar"]

[tool.setuptools_scm]
fallback_version = "999"

[tool.setuptools.package-data]
"*" = ["*.*"]

[tool.black]
line-length = 100

[tool.coverage.run]
source = ["ceos_alos2"]
branch = true


# Mypy
Expand All @@ -61,4 +86,5 @@ warn_no_return = true
module = "tests.*"
allow_untyped_defs = true
disable_error_code = "attr-defined"
known_first_party = "n1_asar"

4 changes: 2 additions & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pip==19.2.3
pip==23.0.1
bump2version==0.5.11
wheel==0.33.6
wheel==0.43.0
watchdog==0.9.0
tox==3.14.0
coverage==4.5.4
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Unit test package for safe_asar."""
"""Unit test package for n1_asar."""
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python =
[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 safe_asar tests
commands = flake8 n1_asar tests

[testenv]
setenv =
Expand Down

0 comments on commit 25df817

Please sign in to comment.