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

Introduce type checking with pytype #68

Merged
merged 10 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: 'bug'
assignees: ''

---

**Note:** Not all fields are obligatory, but the more details you provide, the easier it will be for us to address the issue. Feel free to omit sections that you feel are not relevant to your report.

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

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error

**Expected Behavior**
A clear and concise description of what you expected to happen.

**Actual Behavior**
Describe what actually happened. Include screenshots, if applicable.

**`tsdf` Version**
- The version of `tsdf` used (e.g., 0.2.0).

**Environment Details**
- OS: [e.g., Ubuntu]
- OS Version: [e.g., 22.04]
- Python Version: [e.g., 3.8]
- Dependencies Versions: Run `pip freeze` or provide the `poetry.lock` file if possible.

**Error Logs and Messages**
Paste any error logs or error messages encountered here.

**Attempted Solutions or Workarounds**
Describe any attempted solutions or workarounds you have tried.

**Additional Context**
Add any other context about the problem here. For example, whether the issue occurs sporadically or consistently, any patterns noticed, etc.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: 'enhancement'
assignees: ''

---

**Note:** Not all fields are obligatory. We appreciate any and all ideas you wish to share, so please don't hesitate to submit a request even if you can't fill out every section. The more context you provide, the better we can understand and evaluate your suggestion.

**Feature Description**
A clear and concise description of the feature you're proposing.

**Problem and Motivation**
Please describe the problem you are facing or the limitation with the current setup. Explain the motivation behind this feature request. For example, "I'm always frustrated when [...]."

**Describe the solution you'd like**
A detailed description of the feature you would like to see implemented. Include any specific functionality and how you envision it working within the existing project.

**Describe alternatives you've considered**
A brief description of any alternative solutions or features you've considered. Why are they less desirable than your proposed solution?

**Potential Impacts**
Discuss any potential impacts this feature may have on the project, such as performance, size, dependencies, or compatibility.

**Examples and Mockups**
If applicable, provide examples, mockups, or code snippets to illustrate how your feature would work. This could be as simple as a brief code example or a link to a similar feature in another project.

**Additional Context**
Add any other context or screenshots about the feature request here. This can include use cases, benefits to other users, or any other information that might help understand the value of the feature.
44 changes: 44 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Pull Request
about: Create a pull request to contribute to the project
title: ''
labels: ''
assignees: ''

---

## Description
<!-- Provide a detailed description of the changes or features implemented in this pull request. Explain the problem it solves or the feature it adds to the project. -->

## Related Issue(s)
<!-- List related issues or tasks that this pull request addresses. Use the format `#issue_number` to automatically link them here. -->

## Type of Change
<!-- Identify the type of change(s) made in this pull request. Check all that apply. -->
- [ ] Bug fix
- [ ] New feature
- [ ] Enhancement to an existing feature
- [ ] Documentation update
- [ ] Other (please specify):

## How Has This Been Tested?
<!-- Describe the tests that you ran to verify your changes. Include relevant details for your test configuration or mention which tests cover these changes. -->

## Checklist
- [ ] I have followed the project's style guidelines.
- [ ] My code includes relevant unit tests to cover my changes.
- [ ] I have updated the documentation to reflect my changes (if applicable).
- [ ] My changes do not introduce any new warnings or errors.
- [ ] I have performed a self-review of my own code.
- [ ] All new and existing unit tests pass successfully with my changes.
- [ ] My commit messages are clear and meaningful.

## Additional Notes
<!-- Include any additional information, or notes that may be relevant or helpful to reviewers. -->

## Impact
<!-- Describe any potential impacts this change may have on the project. This can include, but is not limited to, performance implications, changes in behavior, or dependency updates. -->

## Reviewer(s)
<!-- Optionally tag any specific reviewers you would like to review your pull request. -->

2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Python package

on:
push:
branches: [ main, improve-docs ]
branches: [ main ]
pull_request:
branches: [ main ]

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pytype-checking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pytype Type Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install poetry
poetry install

- name: Run pytype
run: poetry run pytype .
58 changes: 33 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
# Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

## Types of Contributions

### Report Bugs

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.

### Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.

### Implement Features

Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.

### Write Documentation

You can never have enough documentation! Please feel free to contribute to any
part of the documentation, such as the official docs, docstrings, or even
on the web in blog posts, articles, and such.
You can never have enough documentation! Feel free to contribute to any part of the documentation, including official docs, docstrings, or web content like blog posts, articles, etc.

### Submit Feedback

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and contributions are welcome :)

## General Python Practices

When contributing to this project, please adhere to the following Python practices:

- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) for style guide recommendations.
- Ensure your code is clean, efficient, and well-documented. All methods must include documentation that follows the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), clearly describing the method's purpose, its arguments, return values, and any exceptions raised.

## Get Started!

Expand All @@ -49,25 +50,32 @@ Ready to contribute? Here's how to set up `tsdf` for local development.
$ poetry install
```

3. Use `git` (or similar) to create a branch for local development and make your changes:
3. Create a branch for local development:

```console
$ git checkout -b name-of-your-bugfix-or-feature
```

4. When you're done making changes, check that your changes conform to any code formatting requirements and pass any tests.
4. Make your changes and ensure they meet the code formatting and documentation standards.

5. Check that your changes pass all tests.

6. Commit your changes and push to the branch:

```console
$ git push origin name-of-your-bugfix-or-feature
```

5. Commit your changes and open a pull request.
7. Submit a pull request through GitHub.

## Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:
Before you submit a pull request, ensure it meets these guidelines:

1. The pull request should include additional tests if appropriate.
2. If the pull request adds functionality, the docs should be updated.
3. The pull request should work for all currently supported operating systems and versions of Python.
1. The pull request should include tests that prove any new functionality works as expected.
2. If the pull request adds functionality, the documentation should be updated accordingly.
3. The pull request should work for Python's currently supported versions and major operating systems.

## Code of Conduct

Please note that the `tsdf` project is released with a
Code of Conduct. By contributing to this project you agree to abide by its terms.
Please note that the `tsdf` project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| Badges | |
|:----:|----|
| **Packages and Releases** | [![Latest release](https://img.shields.io/github/release/biomarkersparkinson/tsdf.svg)](https://github.com/biomarkersparkinson/tsdf/releases/latest) [![PyPI](https://img.shields.io/pypi/v/tsdf.svg)](https://pypi.python.org/pypi/tsdf/) [![Static Badge](https://img.shields.io/badge/RSD-tsdf-lib)](https://research-software-directory.org/software/tsdf) |
| **Build Status** | [![](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/) ![Python package](https://github.com/biomarkersparkinson/tsdf/workflows/Python%20package/badge.svg) |
| **Build Status** | [![](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/) ![Python package](https://github.com/biomarkersparkinson/tsdf/workflows/Python%20package/badge.svg) [![pytype Type Check](https://github.com/biomarkersParkinson/tsdf/actions/workflows/pytype-checking.yml/badge.svg)](https://github.com/biomarkersParkinson/tsdf/actions/workflows/pytype-checking.yml) |
| **DOI** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7867899.svg)](https://doi.org/10.5281/zenodo.7867899) |
| **License** | [![GitHub license](https://img.shields.io/github/license/biomarkersParkinson/tsdf)](https://github.com/biomarkersparkinson/tsdf/blob/main/LICENSE) |
| **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8083/badge)](https://www.bestpractices.dev/projects/8083) |
Expand Down Expand Up @@ -48,7 +48,11 @@ mkdocs gh-deploy # deploy the documentation to GitHub pages

## Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details on coding standards, how to get started, and the submission process.

## Code of Conduct

To ensure a welcoming and respectful community, all contributors and participants are expected to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms.

## License

Expand Down
Loading
Loading