forked from nsidc/earthaccess
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace pkg_resources with importlib.resources
Fix "DeprecationWarning: pkg_resources is deprecated as an API." seen when running tests. In addition: - increase test coverage for `formatters.py` - replace deprecated `set-output` in `test.yml` workflow - remove redundant lines in `Makefile` - make minor grammatical and formatting fixes to `CONTRIBUTING.md` - remove old, redundant "Code of Conduct" section from `CONTRIBUTING.md` and insert link to `CODE_OF_CONDUCT.md` - fix bare links in `CODE_OF_CONDUCT.md`
- Loading branch information
1 parent
994b178
commit b566edb
Showing
10 changed files
with
129 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,13 @@ include: | |
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
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 | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
|
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers. | |
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. All | ||
reported by contacting the project team at <[email protected]>. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
|
@@ -68,10 +68,9 @@ members of the project's leadership. | |
## 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 | ||
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 | ||
|
||
<https://www.contributor-covenant.org/faq> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,42 +3,64 @@ | |
When contributing to this repository, please first discuss the change you wish to make via issue, | ||
email, or any other method with the owners of this repository before making a change. | ||
|
||
Please note we have a code of conduct, please follow it in all your interactions with the project. | ||
|
||
Please note that we have a [code of conduct](./CODE_OF_CONDUCT.md). Please follow it in all of your interactions with the project. | ||
|
||
## Development environment | ||
|
||
|
||
`earthaccess` is a Python library that uses Poetry to build and publish the package to PyPI, the defacto Python repository. In order to develop new features or patch bugs etc. we need to set up a virtual environment and install the library locally. We can accomplish this with both Poetry or/and Conda. | ||
|
||
### Using Conda | ||
|
||
If we have `mamba` (or conda) installed, we can use the environment file included in the binder folder, this will install all the libraries we need (including Poetry) to start developing `earthaccess` | ||
If we have `mamba` (or `conda`) installed, we can use the environment file included in the `ci` folder. This will install all the libraries we need (including Poetry) to start developing `earthaccess`: | ||
|
||
```bash | ||
>mamba env update -f ci/environment-dev.yml | ||
>mamba activate earthaccess-dev | ||
>poetry install | ||
mamba env update -f ci/environment-dev.yml | ||
mamba activate earthaccess-dev | ||
poetry install | ||
``` | ||
|
||
After activating our environment and installing the library with Poetry we can run Jupyter lab and start testing the local distribution or we can use the scripts inside `scripts` to run the tests and linting. | ||
After activating our environment and installing the library with Poetry we can run Jupyter lab and start testing the local distribution or we can use `make` to run the tests and lint the code. | ||
Now we can create a feature branch and push those changes to our fork! | ||
|
||
|
||
### Using Poetry | ||
|
||
If we want to use Poetry, first we need to [install it](https://python-poetry.org/docs/#installation). After installing Poetry we can use the same workflow we used for Conda, first we install the library locally: | ||
|
||
```bash | ||
>poetry install | ||
poetry install | ||
``` | ||
|
||
and now we can run the local Jupyter Lab and run the scripts etc. using Poetry: | ||
|
||
```bash | ||
>poetry run jupyter lab | ||
poetry run jupyter lab | ||
``` | ||
|
||
### Managing Dependencies | ||
|
||
If you need to add a dependency, you should do the following: | ||
|
||
- Run `poetry add <package>` for a required (non-development) dependency | ||
- Run `poetry add --group=dev <package>` for a development dependency, such | ||
as a testing or code analysis dependency | ||
|
||
Both commands will add an entry to `pyproject.toml` with a version that is | ||
compatible with the rest of the dependencies. However, `poetry` pins versions | ||
with a caret (`^`), which is not what we want. Therefore, you must locate the | ||
new entry in `pyproject.toml` and change the `^` to `>=`. (See | ||
[poetry-relax](https://github.com/zanieb/poetry-relax) for the reasoning behind | ||
this.) | ||
|
||
In addition, you must also add a corresponding entry to | ||
`ci/environment-mindeps.yaml`. You'll notice in that file that required | ||
dependencies should be pinned exactly to the versions specified in | ||
`pyproject.toml` (after changing `^` to `>=` there), and that development | ||
dependencies should be left unpinned. | ||
|
||
Finally, for _development dependencies only_, you must add an entry to | ||
`ci/environment-dev.yaml` with the same version constraint as in | ||
`pyproject.toml`. | ||
|
||
## First Steps to fix an issue or bug | ||
|
||
- Read the documentation (working on adding more) | ||
|
@@ -55,45 +77,47 @@ and now we can run the local Jupyter Lab and run the scripts etc. using Poetry: | |
- create new tests as you go, and run the test suite as you go | ||
- update the documentation as you go | ||
|
||
### Please format and lint as you go with the following scripts | ||
### Please format and lint as you go | ||
|
||
```bash | ||
scripts/lint.sh | ||
scripts/format.sh | ||
make format lint | ||
``` | ||
|
||
### Requirements to merge code (Pull Request Process) | ||
|
||
- you must include test coverage | ||
- you must update the documentation | ||
- you must run the above scripts to format and line | ||
- you must run the command above to format and lint | ||
|
||
## Pull Request process | ||
|
||
1. Ensure you include test coverage for all changes | ||
2. Ensure your code is formatted properly following this document | ||
3. Update the documentation and the README.md with details of changes to the interface, | ||
this includes new environment variables, function names, decorators, etc. | ||
3. Update `CHANGELOG.md` with details about your change in a section titled | ||
1. Ensure your code is formatted properly following this document | ||
1. Update the documentation and the `README.md` with details of changes to the | ||
interface, this includes new environment variables, function names, | ||
decorators, etc. | ||
1. Update `CHANGELOG.md` with details about your change in a section titled | ||
`Unreleased`. If one does not exist, please create one. | ||
4. You may merge the Pull Request in once you have the sign-off of another developers, | ||
or if you do not have permission to do that, you may request the reviewer to merge it | ||
for you. | ||
1. You may merge the Pull Request once you have the sign-off of another | ||
developer, or if you do not have permission to do that, you may request the | ||
reviewer to merge it for you. | ||
|
||
## Release process | ||
|
||
> :memo: The versioning scheme we use is [SemVer](http://semver.org/). Note that until | ||
> we agree we're ready for v1.0.0, we will not increment major version. | ||
> we agree we're ready for v1.0.0, we will not increment the major version. | ||
0. Ensure all desired features are merged to `main` branch and `CHANGELOG` is updated. | ||
1. Ensure all desired features are merged to `main` branch and `CHANGELOG.md` is updated. | ||
1. Use `bump-my-version` to increase the version number in all needed places, e.g. to | ||
increase the minor version (`1.2.3` to `1.3.0`): | ||
``` | ||
|
||
```plain | ||
bump-my-version bump minor | ||
``` | ||
2. Push a tag on the new commit containing the version number, prefixed with `v`, e.g. | ||
|
||
1. Push a tag on the new commit containing the version number, prefixed with `v`, e.g. | ||
`v1.3.0`. | ||
3. [Create a new GitHub Release](https://github.com/nsidc/earthaccess/releases/new). We | ||
1. [Create a new GitHub Release](https://github.com/nsidc/earthaccess/releases/new). We | ||
hand-curate our release notes to be valuable to humans. Please do not auto-generate | ||
release notes and aim for consistency with the GitHub Release descriptions from other | ||
releases. | ||
|
@@ -106,78 +130,3 @@ scripts/format.sh | |
> :memo: `earthaccess` is published to conda-forge through the | ||
> [earthdata-feedstock](https://github.com/conda-forge/earthdata-feedstock), as this | ||
> project was renamed early in its life. The conda package is named `earthaccess`. | ||
--- | ||
|
||
## 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, gender identity and expression, level of experience, | ||
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. | ||
|
||
### Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
### Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
### Attribution | ||
|
||
This Code of Conduct is adapted from the [PurpleBooth's Contributing Template][contributing-template-url] | ||
|
||
[contributing-template-url]: https://gist.github.com/PurpleBooth/b24679402957c63ec426/5c4f62c1e50c1e6654e76e873aba3df2b0cdeea2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.