Skip to content

Commit

Permalink
Merge pull request #642 from RocketPy-Team/develop
Browse files Browse the repository at this point in the history
MNT: Updates master for release `1.4.1`
  • Loading branch information
Gui-FernandesBR authored Jul 20, 2024
2 parents e10666f + d977fbe commit 798b9db
Show file tree
Hide file tree
Showing 113 changed files with 6,668 additions and 6,574 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/lint_black.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Linters

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**.py"
- "**.ipynb"
- ".github/**"
- "pyproject.toml"
- "requirements*"
- ".pylintrc"

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[all]
pip install .[tests]
pip install pylint isort flake8 black
- name: Run isort
run: isort --check-only rocketpy/ tests/ docs/ --profile black
- name: Run black
uses: psf/black@stable
with:
options: "--check rocketpy/ tests/ docs/"
jupyter: true
- name: Run flake8
run: flake8 rocketpy/ tests/
- name: Run pylint
run: |
pylint rocketpy/ tests/
55 changes: 55 additions & 0 deletions .github/workflows/test-pytest-slow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Scheduled Tests

on:
schedule:
- cron: "0 17 */14 * 5" # every 2 weeks, always on a Friday at 17:00
timezone: "America/Sao_Paulo"

defaults:
run:
shell: bash

jobs:
pytest:
if: github.ref == "refs/heads/master" || github.ref == "refs/heads/develop"
runs-on: ubuntu-latest
strategy:
matrix:
fail-fast: false
python-version: [3.9, 3.12]

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install rocketpy
run: pip install .

- name: Test importing rocketpy
run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')"

- name: Install test dependencies
run: |
pip install -r requirements-tests.txt
pip install .[all]
- name: Run Unit Tests
run: pytest tests/unit --cov=rocketpy

- name: Run Documentation Tests
run: pytest rocketpy --doctest-modules --cov=rocketpy --cov-append

- name: Run Integration Tests
run: pytest tests/integration --cov=rocketpy --cov-append

- name: Run Acceptance Tests
run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml

- name: Run slow tests
run: pytest tests -vv -m slow --runslow --cov=rocketpy --cov-append --cov-report=xml
4 changes: 3 additions & 1 deletion .github/workflows/test_pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ jobs:
run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')"

- name: Install test dependencies
run: pip install -r requirements-tests.txt
run: |
pip install -r requirements-tests.txt
pip install .[all]
- name: Run Unit Tests
run: pytest tests/unit --cov=rocketpy
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ cython_debug/
*.docx
*.pdf

# VSCode project settings
.vscode/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
Expand Down
61 changes: 49 additions & 12 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fail-under=10
#from-stdin=

# Files or directories to be skipped. They should be base names, not paths.
ignore=CVS, docs
ignore=CVS, docs, data,

# Add files or directories matching the regular expressions patterns to the
# ignore-list. The regex matches against paths and can be in Posix or Windows
Expand Down Expand Up @@ -212,7 +212,24 @@ good-names=FlightPhases,
fin_set_NACA,
fin_set_E473,
HIRESW_dictionary,

prop_I_11,
Kt, # transformation matrix transposed
clalpha2D,
clalpha2D_incompressible,
r_NOZ, # Nozzle position vector
rocket_dry_I_33,
rocket_dry_I_11,
motor_I_33_at_t,
motor_I_11_at_t,
motor_I_33_derivative_at_t,
motor_I_11_derivative_at_t,
M3_forcing,
M3_damping,
CM_to_CDM,
CM_to_CPM,
center_of_mass_without_motor_to_CDM,
motor_center_of_dry_mass_to_CDM,
generic_motor_cesaroni_M1520,

# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
Expand All @@ -222,6 +239,8 @@ good-names-rgxs= ^[a-z][0-9]?$, # Single lowercase characters, possibly followe
^(dry_|propellant_)[A-Z]+_\d+$, # Variables starting with 'dry_' or 'propellant_', followed by uppercase characters, underscore, and digits
^[a-z]+_ISA$, # Lowercase words ending with '_ISA'
^plot(1D|2D)$, # Variables starting with 'plot' followed by '1D' or '2D'
S_noz*, # nozzle gyration tensor
r_CM*, # center of mass position and its variations

# Include a hint for the correct naming format with invalid-name.
include-naming-hint=no
Expand Down Expand Up @@ -312,16 +331,16 @@ exclude-too-few-public-methods=
ignored-parents=

# Maximum number of arguments for function / method.
max-args=10
max-args=15

# Maximum number of attributes for a class (see R0902).
max-attributes=30
max-attributes=50

# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5

# Maximum number of branch for function / method body.
max-branches=12
max-branches=25

# Maximum number of locals for function / method body.
max-locals=30
Expand All @@ -330,16 +349,16 @@ max-locals=30
max-parents=7

# Maximum number of public methods for a class (see R0904).
max-public-methods=40
max-public-methods=25

# Maximum number of return / yield for function / method body.
max-returns=6
max-returns=25

# Maximum number of statements in function / method body.
max-statements=50
max-statements=25

# Minimum number of public methods for a class (see R0903).
min-public-methods=2
min-public-methods=0


[EXCEPTIONS]
Expand Down Expand Up @@ -454,14 +473,32 @@ disable=raw-checker-failed,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
deprecated-pragma, # because we have some peniding deprecations in the code.
use-symbolic-message-instead,
use-implicit-booleaness-not-comparison-to-string,
use-implicit-booleaness-not-comparison-to-zero,
no-else-return,
no-else-return, # this is a style preference, we don't need to follow it
inconsistent-return-statements,
unspecified-encoding,
unspecified-encoding, # this is not a relevant issue.
no-member, # because we use funcify_method decorator
invalid-overridden-method, # because we use funcify_method decorator
too-many-function-args, # because we use funcify_method decorator
fixme, # because we use TODO in the code
missing-module-docstring, # not useful for most of the modules.
attribute-defined-outside-init, # to avoid more than 200 errors (code works fine)
not-an-iterable, # rocketpy Functions are iterable, false positive
too-many-function-args, # gives false positives for Function calls
method-hidden, # avoids some errors in tank_geometry and flight classes
missing-timeout, # not a problem to use requests without timeout
protected-access, # we use private attriubutes out of the class (maybe we should fix this)
duplicate-code, # repeating code is a bad thing, but should we really care about it?
line-too-long, # black already takes care of this
missing-function-docstring, # this is too verbose.
redefined-outer-name, # too verbose, and doesn't add much value
method-cache-max-size-none,
no-else-raise, # pointless



# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
23 changes: 23 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"recommendations": [
"ambooth.git-rename",
"github.vscode-pull-request-github",
"gruntfuggly.todo-tree",
"mechatroner.rainbow-csv",
"ms-python.black-formatter",
"ms-python.debugpy",
"ms-python.pylint",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-vscode.cmake-tools",
"ms-vscode.makefile-tools",
"njpwerner.autodocstring",
"streetsidesoftware.code-spell-checker",
"trond-snekvik.simple-rst",
]
}
Loading

0 comments on commit 798b9db

Please sign in to comment.