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

Added development section to the readme #44

Merged
merged 7 commits into from
Aug 29, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ docs/source/sg_execution_times.rst
docs/site
docs/generated
site
src/osipi.egg-info
16 changes: 0 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,9 @@ repos:
- id: ruff
args: [--fix] # Optional: to enable lint fixes
- id: ruff-format
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args:
- --exclude=venv,.git,__pycache__,.eggs,.mypy_cache,.pytest_cache
- --max-line-length=100
- --ignore=E203
- --per-file-ignores=__init__.py:F401
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml

- repo: https://github.com/rstcheck/rstcheck
rev: v6.1.2 # Use the latest version
hooks:
- id: rstcheck
args: ["--ignore-directives=autosummary,autofunction,minigallery,image-sg","--ignore-messages=(Hyperlink target *|Duplicate explicit target name*)"]
additional_dependencies: [sphinx]
5 changes: 0 additions & 5 deletions .rstcheck.cfg

This file was deleted.

67 changes: 66 additions & 1 deletion README.md
ltorres6 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,72 @@ We welcome contributions to OSIPI! To contribute, follow these steps:
- Push your changes to your fork.
- Submit a pull request to the main OSIPI repository.

For more details on how to contribute, visit the [Developer Guide](https://osipi.github.io/pypi/developers_guide/index.html).
## Development Setup

We use poetry to manage the dependencies for this project.

### Using Poetry

1. If you don't have Poetry installed, you can install it using pip:

```bash
pip install poetry
```

Or, if you're using a Unix-based system, you can install it using the following command:

```bash
curl -sSL https://install.python-poetry.org | python3 -
```

For more information on installing Poetry, see the [official documentation](https://python-poetry.org/docs/)
2. Clone the repository to your local machine.
3. Navigate to the project directory.
4. Install the project dependencies with Poetry:

```bash
poetry install
```

5. Activate the Poetry environment:

```bash
poetry shell
```

## Setting up pre-commit

`pre-commit` is a tool that we use to maintain high-quality code in this project. It runs checks (hooks) on your code each time you commit changes. Here's how to set it up:

## Pre-Commit Hooks
Pre-commit hooks are scripts that run automatically before a commit is made in a Git repository. They help catch common issues like syntax errors, formatting problems, and other code quality issues.

### Example hooks
- `flake8` - a linter that checks your code for common errors and style issues.
- `trailing-whitespace` - a hook that removes trailing whitespace from your files.
- `ruff` - also a linter that checks your code for common errors and style issues.
- `end of file fixer` - a hook that ensures that all files end with a newline.
- `check yaml`

We are using pre-commit configuration file to define our hooks. You can find the configuration file [here](https://github.com/OSIPI/osipi/blob/main/.pre-commit-config.yaml)

1. In the project directory, run the following command to install the `pre-commit` hooks:

```bash
pre-commit install
```

2. You can run all pre-commit hooks on all files with:

```bash
pre-commit run --all-files
```
**NOTE:**
- Next time you commit changes, `pre-commit` will run the hooks automatically.
- Some hooks automatically fix/format your files to specific standards. If you see that some of your files have been changed after a commit, don't worry! It's just `pre-commit` doing its job.
Add the changes and commit them again.

For more details on how to contribute, visit the [Developer Guide](https://osipi.github.io/pypi/contribution/#making-a-pull-request-pr-to-the-osipi-package).
#### As mentioned before, this project is still in the early stages of development. If you'd like to contribute by adding functionality, we recommend opening an issue first to discuss your proposed functionality and the best ways to implement it.

## Details
Expand Down
71 changes: 0 additions & 71 deletions manage.py

This file was deleted.

4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ theme:

plugins:
- mkdocstrings:
default_handler: python
handlers:
python:
paths: ["src"]
- gallery:
examples_dirs: docs/examples
gallery_dirs: docs/generated/gallery
Expand Down
Loading
Loading