Skip to content

Commit

Permalink
Merge pull request #8 from stactools-packages/create-pull-request/patch
Browse files Browse the repository at this point in the history
Sync with stacktools-packages/template
  • Loading branch information
scottyhq authored Aug 5, 2021
2 parents 00f4293 + e3c5a04 commit fe0ef70
Show file tree
Hide file tree
Showing 41 changed files with 418 additions and 77 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
.github
.gitignore
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
docker_env
README.md
48 changes: 48 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# https://EditorConfig.org

root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

# Ignore paths
[/tests/data-files/**]
charset = unset
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_style = unset
indent_size = unset

[*.ipynb]
# Content is json, but it seems to be minimally formatted
indent_size = unset

[{*.json,.ecrc}]
indent_size = 2

[Makefile]
indent_style = tab

[make.bat]
end_of_line = crlf
indent_style = tab

[*.md]
indent_size = unset

[{*.py,setup.cfg}]
# yapf and black will use indents other than 4 spaces
indent_size = unset

[*.rst]
indent_size = unset

[*.yml]
indent_size = 2
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior:

> Ex.
>
> 1. Install stactools-sentinel1
> 2. Run `scripts/test`
> 3. See error
**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots and shell session dumps**
If applicable, add session dumps and/or screenshots to help explain your problem.

> ex. `scripts/lint >> lint_errors.txt`
**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen. Ex. I would like to use stac <package> to do [...]

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Before you submit a pull request, please fill in the following:

**Related Issue(s):**
Please add links (if any) to related github issues.

**Description:**
Please explain the changes you made here.

**PR checklist:**

- [ ] Code is formatted (run `scripts/format`).
- [ ] Code lints properly (run `scripts/lint`).
- [ ] Tests pass (run `scripts/test`).
- [ ] Documentation has been updated to reflect changes, if applicable.
- [ ] Changes are added to the [CHANGELOG](../CHANGELOG.md).
28 changes: 26 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
packages: write
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
-
name: Checkout
uses: actions/checkout@v2
Expand All @@ -76,6 +80,18 @@ jobs:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run rename script if in the template repo
run: |
if [[ "$GITHUB_REPOSITORY" == */template ]]; then
scripts/rename
fi
- name: Source build args
run: |
source ./docker_env
STACTOOLS_VERSION=$(python scripts/stactools-version.py)
echo "stactools_version=$STACTOOLS_VERSION" >> $GITHUB_ENV
echo "docker_workdir=$DOCKER_WORKDIR" >> $GITHUB_ENV
echo "docker_namespace_package_dir=$DOCKER_NAMESPACE_PACKAGE_DIR" >> $GITHUB_ENV
-
name: Docker meta main
id: meta-main
Expand All @@ -91,8 +107,12 @@ jobs:
with:
context: .
file: docker/Dockerfile
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
# Don't try to push if the event is a PR from a fork
push: ${{ github.event_name != 'pull_request' || github.head_ref.repo.full_name == github.repository }}
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
tags: ${{ steps.meta-main.outputs.tags }}
labels: ${{ steps.meta-main.outputs.labels }}
-
Expand All @@ -112,7 +132,11 @@ jobs:
with:
context: .
file: docker/Dockerfile-dev
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
# Don't try to push if the event is a PR from a fork
push: ${{ github.event_name != 'pull_request' || github.head_ref.repo.full_name == github.repository }}
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
tags: ${{ steps.meta-dev.outputs.tags }}
labels: ${{ steps.meta-dev.outputs.labels }}
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
packages: write
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
-
name: Checkout
uses: actions/checkout@v2
Expand All @@ -49,6 +53,18 @@ jobs:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Source build args
run: |
source ./docker_env
STACTOOLS_VERSION=$(python scripts/stactools-version.py)
echo "stactools_version=$STACTOOLS_VERSION" >> $GITHUB_ENV
echo "docker_workdir=$DOCKER_WORKDIR" >> $GITHUB_ENV
echo "docker_namespace_package_dir=$DOCKER_NAMESPACE_PACKAGE_DIR" >> $GITHUB_ENV
- name: Run rename script if in the template repo
run: |
if [[ "$GITHUB_REPOSITORY" == */template ]]; then
scripts/rename
fi
-
name: Docker meta main
id: meta-main
Expand All @@ -65,6 +81,10 @@ jobs:
with:
context: .
file: docker/Dockerfile
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
push: true
tags: ${{ steps.meta-main.outputs.tags }}
labels: ${{ steps.meta-main.outputs.labels }}
Expand All @@ -85,6 +105,10 @@ jobs:
with:
context: .
file: docker/Dockerfile-dev
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
push: true
tags: ${{ steps.meta-dev.outputs.tags }}
labels: ${{ steps.meta-dev.outputs.labels }}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project attempts to match the major and minor versions of [stactools](https://github.com/stac-utils/stactools) and increments the patch number as needed.

## [Unreleased]

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.
54 changes: 54 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>

[homepage]: <https://www.contributor-covenant.org>

For answers to common questions about this code of conduct, see
<https://www.contributor-covenant.org/faq>
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Contributing

Pull Requests are the primary method of contributing to stactools-packages. Everyone is welcome to submit a stactools-package to describe their data. The intent with this project to get data which can be described by [STAC](https://stacspec.org/) to be built in an open and interoperable manner.

We consider everyone using the stactools-packages to be a 'contributor'.

## Deprecation

We recommend following the [Numpy Enhancement Proposals (NEP) 29](https://numpy.org/neps/nep-0029-deprecation_policy.html)
suggested deprecation policy for supported python versions.

>When a project releases a new major or minor version, we recommend that they support at least all minor versions of Python introduced and released in the prior 42 months from the anticipated release date with a minimum of 2 minor versions of Python, and all minor versions of NumPy released in the prior 24 months from the anticipated release date with a minimum of 3 minor versions of NumPy.
## Submitting Pull Requests

Any proposed changes to an existing stactools-packages should be done as pull requests. Please make these
requests against the `main` branch (unless otherwise directed by the dataset maintainer).

Creating a Pull Request will show our PR template, which includes checkbox reminders for a number
of things.

- Adding an entry the [CHANGELOG](CHANGELOG.md). If the change is more editorial and minor then this is not required, but any change to the actual code should have one.
- Make a ticket in the stactools-package data specific repository which is tracked on the [project management board](https://github.com/orgs/stactools-packages/projects/1).
- Highlight if the PR makes breaking changes to the code.


---
Attribution:
- https://docs.github.com/en/communities/
- https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md
9 changes: 6 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
ARG STACTOOLS_VERSION=latest
FROM ghcr.io/stac-utils/stactools:$STACTOOLS_VERSION

WORKDIR /opt/stactools-sentinel1
ARG DOCKER_NAMESPACE_PACKAGE_DIR
ARG DOCKER_WORKDIR
ENV PYTHON_VERSION=3.9
WORKDIR $DOCKER_WORKDIR

# For caching purposes, install dependencies but remove the actual package
COPY pyproject.toml setup.cfg ./
COPY src/stactools/sentinel1/__init__.py src/stactools/sentinel1/
COPY src/$DOCKER_NAMESPACE_PACKAGE_DIR/__init__.py src/$DOCKER_NAMESPACE_PACKAGE_DIR/
RUN pip install . \
&& rm -r /opt/conda/lib/python3.8/site-packages/stactools/sentinel1
&& rm -r /opt/conda/lib/python$PYTHON_VERSION/site-packages/$DOCKER_NAMESPACE_PACKAGE_DIR

COPY src ./src
RUN pip install .
9 changes: 6 additions & 3 deletions docker/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
ARG STACTOOLS_VERSION=latest
FROM ghcr.io/stac-utils/stactools:${STACTOOLS_VERSION}-dev

WORKDIR /opt/stactools-sentinel1
ARG DOCKER_NAMESPACE_PACKAGE_DIR
ARG DOCKER_WORKDIR
ENV PYTHON_VERSION=3.9
WORKDIR $DOCKER_WORKDIR

# For caching purposes, install dependencies but remove the actual package
COPY pyproject.toml requirements-dev.txt setup.cfg ./
COPY src/stactools/sentinel1/__init__.py src/stactools/sentinel1/
COPY src/$DOCKER_NAMESPACE_PACKAGE_DIR/__init__.py src/$DOCKER_NAMESPACE_PACKAGE_DIR/
RUN pip install -r requirements-dev.txt \
&& pip install . \
&& rm -r /opt/conda/lib/python3.8/site-packages/stactools/sentinel1
&& rm -r /opt/conda/lib/python$PYTHON_VERSION/site-packages/$DOCKER_NAMESPACE_PACKAGE_DIR

COPY . ./
RUN pip install -e .
3 changes: 2 additions & 1 deletion docker/Dockerfile-script-runner
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM python:3-buster

WORKDIR /opt/stactools-sentinel1
ARG DOCKER_WORKDIR
WORKDIR $DOCKER_WORKDIR
COPY requirements-dev.txt ./
RUN pip install -r requirements-dev.txt

Expand Down
Loading

0 comments on commit fe0ef70

Please sign in to comment.