Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to src layout #903

Merged
merged 6 commits into from
Nov 9, 2022
Merged

switch to src layout #903

merged 6 commits into from
Nov 9, 2022

Conversation

yunjunz
Copy link
Member

@yunjunz yunjunz commented Nov 9, 2022

Description of proposed changes

  • switch mintpy to the standard src/mintpy layout for the source code, to fix pip -e installed mintpy.__file__ = None when there is a mintpy folder in current dir #882 as suggested by @scottstanie.

  • move and rename mintpy/data/input_files to docs/templates

  • update links and paths for 1) the src layout, 2) the renamed template dir and 3) $MINTPY_HOME usage:

    • docs/api/attributes.md
    • docs/api/colormaps.md
    • docs/dask.md
    • docs/demo_dataset.md
    • docs/google_earth.md
    • docs/hdfeos5.md
    • docs/installation.md
    • docs/README.md
    • mkdocs.yml
  • update setup.py:

    • update "version" and "packages" setting for the new src layout
    • remove data/input_files from the package_data section
  • version: use .postX style for the commits after release, to be consistent with pip convention

Reminders

  • Pass Codacy code review (green)
  • Pass Pre-commit check (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

+ move "mintpy" to "src/mintpy"
+ setup.py: update "version" and "packages" settings for the new src layout
+ move/rename "mintpy/data/input_files" to "docs/templates"
   - setup.py: remove "data/input_files" from the package data section

+ update links for the new "src" layout in:
   - docs/api/attributes.md
   - docs/google_earth.md
   - docs/hdfeos5.md
   - docs/README.md
   - mkdocs.yml
Copy link
Collaborator

@jhkennedy jhkennedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! I haven't fully tested the pip build/install yet but will do so in the morning

docs/installation.md Outdated Show resolved Hide resolved
Copy link
Contributor

@scottstanie scottstanie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

(mapping) staniewi:MintPy$ ls /Users/staniewi/miniconda3/envs/mapping/lib/python3.10/site-packages/__editabl*mint*
/Users/staniewi/miniconda3/envs/mapping/lib/python3.10/site-packages/__editable__.mintpy-1.4.1.post43.pth
(mapping) staniewi:MintPy$ cat /Users/staniewi/miniconda3/envs/mapping/lib/python3.10/site-packages/__editabl*mint*
/Users/staniewi/repos/MintPy/src


(mapping) staniewi:MintPy$ cd
(mapping) staniewi:~$ mkdir -p mintpy


(mapping) staniewi:~$ python
Python 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:07:06) [Clang 13.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mintpy
>>> mintpy.__file__
'/Users/staniewi/repos/MintPy/src/mintpy/__init__.py'

setup.py Show resolved Hide resolved
+ installation: revert back $MINTPY_HOME to the path of "MintPy" folder, from "MintPy/src".

+ update usage of MINTPY_HOME for the "src" layout
Copy link
Collaborator

@jhkennedy jhkennedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and is working the way I'd expect.

@yunjunz yunjunz merged commit 0b0a8eb into insarlab:main Nov 9, 2022
@yunjunz yunjunz deleted the src branch November 9, 2022 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip -e installed mintpy.__file__ = None when there is a mintpy folder in current dir
3 participants