Skip to content

Commit

Permalink
Merge pull request #1036 from gboeing/lint
Browse files Browse the repository at this point in the history
add linters
  • Loading branch information
gboeing committed Jul 15, 2023
2 parents 58b417d + 73610e5 commit 027a0b2
Show file tree
Hide file tree
Showing 39 changed files with 1,031 additions and 958 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Report a bug
description: Report a bug in OSMnx's code
labels: bug
body:

- type: markdown
attributes:
value: "Thanks for using OSMnx!"
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_proposal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Propose a feature
description: Propose an enhancement before opening a pull request to add it
labels: enh
body:

- type: markdown
attributes:
value: "Thanks for using OSMnx!"
Expand Down
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Before you proceed, review the contributing guidelines in the CONTRIBUTING.md fi

In this pull request, please include:

- a reference to related issue(s)
- a description of the changes proposed in the pull request
- an example code snippet illustrating usage of the new functionality
- a reference to related issue(s)
- a description of the changes proposed in the pull request
- an example code snippet illustrating usage of the new functionality
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,23 @@ on:
pull_request:
branches: [main]
schedule:
- cron: '0 6 * * 1' # Every Monday at 06:00 UTC
- cron: "0 6 * * 1" # Every Monday at 06:00 UTC

jobs:

build:

name: Python ${{ matrix.python-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest]

defaults:
run:
shell: bash -elo pipefail {0}

steps:

- name: Checkout repo
uses: actions/checkout@v3
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ name: Test minimal versions

on:
schedule:
- cron: '0 7 * * 1' # Every Monday at 07:00 UTC
- cron: "0 7 * * 1" # Every Monday at 07:00 UTC
workflow_dispatch:

jobs:

build:

name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -21,7 +19,6 @@ jobs:
shell: bash -elo pipefail {0}

steps:

- name: Checkout repo
uses: actions/checkout@v3
with:
Expand Down
13 changes: 9 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: "v4.4.0"
hooks:
- id: check-added-large-files
args: [--maxkb=50]
Expand All @@ -23,13 +23,18 @@ repos:
args: [--branch, main]
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
hooks:
- id: prettier
types_or: [markdown, yaml]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: "23.7.0"
hooks:
- id: black
args: ["--check"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
rev: "v0.0.278"
hooks:
- id: ruff
666 changes: 333 additions & 333 deletions CHANGELOG.md

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ Thanks for using OSMnx and for considering contributing to it by opening an issu

#### If you have a "how-to" or usage question:

- please ask your question on [StackOverflow](https://stackoverflow.com/search?q=osmnx), as we reserve the issue tracker for bug reports and new feature development. Any such questions asked in the issue tracker will be automatically closed.
- please ask your question on [StackOverflow](https://stackoverflow.com/search?q=osmnx), as we reserve the issue tracker for bug reports and new feature development. Any such questions asked in the issue tracker will be automatically closed.

#### If you're having an installation problem:

- make sure you've followed the installation instructions in the [documentation](https://osmnx.readthedocs.io/)
- if you installed OSMnx via conda-forge, please open an issue at its [feedstock](https://github.com/conda-forge/osmnx-feedstock/issues)
- make sure you've followed the installation instructions in the [documentation](https://osmnx.readthedocs.io/)
- if you installed OSMnx via conda-forge, please open an issue at its [feedstock](https://github.com/conda-forge/osmnx-feedstock/issues)

#### If you've found a bug:

- read the error message, then review the [documentation](https://osmnx.readthedocs.io/) and [OSMnx examples](https://github.com/gboeing/osmnx-examples) gallery, which cover key concepts, installation, and package usage
- search through the [open issues](https://github.com/gboeing/osmnx/issues?q=is%3Aopen+is%3Aissue) and [closed issues](https://github.com/gboeing/osmnx/issues?q=is%3Aissue+is%3Aclosed) to see if the problem has already been reported
- if the problem is with a dependency of OSMnx, open an issue in the dependency's repo
- if the problem is with OSMnx itself and you can fix it simply, please open a pull request
- if the problem persists, please open an issue in the [issue tracker](https://github.com/gboeing/osmnx/issues), and *provide all the information requested in the template*, including a minimal working example so others can independently and completely reproduce the problem
- read the error message, then review the [documentation](https://osmnx.readthedocs.io/) and [OSMnx examples](https://github.com/gboeing/osmnx-examples) gallery, which cover key concepts, installation, and package usage
- search through the [open issues](https://github.com/gboeing/osmnx/issues?q=is%3Aopen+is%3Aissue) and [closed issues](https://github.com/gboeing/osmnx/issues?q=is%3Aissue+is%3Aclosed) to see if the problem has already been reported
- if the problem is with a dependency of OSMnx, open an issue in the dependency's repo
- if the problem is with OSMnx itself and you can fix it simply, please open a pull request
- if the problem persists, please open an issue in the [issue tracker](https://github.com/gboeing/osmnx/issues), and _provide all the information requested in the template_, including a minimal working example so others can independently and completely reproduce the problem

#### If you have a feature proposal or want to contribute:

- post your proposal on the [issue tracker](https://github.com/gboeing/osmnx/issues), and *provide all the information requested in the template*, so we can review it together (some proposals may not be a good fit for the project)
- fork the repo, make your change, [test it](./tests), and submit a PR
- respond to code review
- adhere to the following project standards
- `black` code style with max line length of 100
- `isort` sorted imports
- `numpy` style docstrings
- post your proposal on the [issue tracker](https://github.com/gboeing/osmnx/issues), and _provide all the information requested in the template_, so we can review it together (some proposals may not be a good fit for the project)
- fork the repo, make your change, [test it](./tests), and submit a PR
- respond to code review
- adhere to the following project standards
- `black` code style with max line length of 100
- `isort` sorted imports
- `numpy` style docstrings

This project requires minimum Python and NumPy versions in accordance with [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

If you use OSMnx in your work, please cite the journal article:

Boeing, G. 2017. "[OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks](https://geoffboeing.com/publications/osmnx-complex-street-networks/)." *Computers, Environment and Urban Systems* 65, 126–139.
Boeing, G. 2017. "[OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks](https://geoffboeing.com/publications/osmnx-complex-street-networks/)." _Computers, Environment and Urban Systems_ 65, 126–139.

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ build:
formats: all

python:
install:
- requirements: docs/requirements.txt
install:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/conf.py
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
project = "OSMnx"

# dynamically load version from /osmnx/_version.py
with open("../osmnx/_version.py") as f:
with Path.open("../osmnx/_version.py") as f:
version = release = f.read().split(" = ")[1].replace('"', "")

# mock import all required + optional dependency packages because readthedocs
Expand Down
2 changes: 1 addition & 1 deletion docs/user-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ User Reference

User Reference for the OSMnx package.

This guide describes the usage of OSMnx's public API. Every function can be accessed via `ox.module_name.function_name()` and many can also be accessed directly via `ox.function_name()` as a shortcut.
This guide describes the usage of OSMnx's public API. Every function can be accessed via ``ox.module_name.function_name()`` and many can also be accessed directly via ``ox.function_name()`` as a shortcut.

If you are looking for an introduction to OSMnx, read the :doc:`getting-started` guide.

Expand Down
2 changes: 1 addition & 1 deletion environments/linux/create-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
ENV=ox
PACKAGE=osmnx
eval "$(conda shell.bash hook)"
conda activate base
conda deactivate
mamba env remove -n $ENV --yes
mamba clean --all --yes --quiet --no-banner
mamba create -c conda-forge --strict-channel-priority -n $ENV --file "../docker/requirements.txt" --yes --no-banner
Expand Down
2 changes: 1 addition & 1 deletion environments/windows/create-environment.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SET ENV="ox"
SET PACKAGE="osmnx"
CALL %USERPROFILE%\mambaforge\Scripts\activate.bat && ^
conda activate base && ^
conda deactivate && ^
mamba env remove -n %ENV% --yes && ^
mamba clean --all --yes --quiet --no-banner && ^
mamba create -c conda-forge --strict-channel-priority -n %ENV% --file "../docker/requirements.txt" --yes --no-banner && ^
Expand Down
Loading

0 comments on commit 027a0b2

Please sign in to comment.