Skip to content

Commit

Permalink
Merge pull request #536 from RocketPy-Team/develop
Browse files Browse the repository at this point in the history
ENH: update master with develop for version 1.2.0
  • Loading branch information
Gui-FernandesBR authored Feb 12, 2024
2 parents 1e955ba + 9da1542 commit 9055923
Show file tree
Hide file tree
Showing 89 changed files with 83,026 additions and 3,675 deletions.
20 changes: 0 additions & 20 deletions .github/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
# Set to true to add reviewers to PRs
addReviewers: true

# Set to 'author' to add PR's author as a assignee
addAssignees: author

# A list of reviewers to be added to PRs (GitHub user name)
reviewers:
- Gui-FernandesBR
- giovaniceotto
- MateusStano
- phmbressan

# A number of reviewers added to the PR
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0

# A list of keywords to be skipped the process if PR's title include it
skipKeywords:
- wip
- work in progress
- draft
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- [ ] Tests for the changes have been added (if needed)
- [ ] Docs have been reviewed and added / updated
- [ ] Lint (`black rocketpy/ tests/`) has passed locally
- [ ] All tests (`pytest --runslow`) have passed locally
- [ ] All tests (`pytest tests -m slow --runslow`) have passed locally
- [ ] `CHANGELOG.md` has been updated (if relevant)

## Current behavior
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
coverage:
status:
project:
default:
# basic
target: auto
threshold: 1%
base: auto
flags:
- unit
paths:
- "rocketpy"
# advanced settings
branches:
- master
- develop
if_ci_failed: error #success, failure, error, ignore
informational: false
only_pulls: false
patch:
default:
# basic
target: auto
threshold: 1%
base: auto
# advanced
branches:
- master
- develop
if_ci_failed: error #success, failure, error, ignore
only_pulls: false
flags:
- "unit"
paths:
- "rocketpy"
2 changes: 1 addition & 1 deletion .github/workflows/lint_black.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: 3.8

- name: Install Python dependencies
run: pip install black
run: pip install black[jupyter]

- name: Run linters
uses: wearerequired/lint-action@v1
Expand Down
100 changes: 57 additions & 43 deletions .github/workflows/test_pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyTest
name: Tests

on:
pull_request:
Expand All @@ -7,58 +7,72 @@ on:
- "**.py"
- ".github/**"

defaults:
run:
shell: bash

jobs:
fail_if_pr_is_draft:
if: github.event.pull_request.draft == true
runs-on: ubuntu-18.04
steps:
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass.
run: exit 1
pytest_and_doctest:
Pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- 3.8
- 3.12
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.12]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Build RocketPy (without optional dependencies)
run: |
pip install .
- name: Import rocketpy in python and test if it works
run: |
python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')"
- name: Install optional dependencies
run: |
pip install -r requirements-tests.txt
- name: Test with pytest
run: |
pytest --cov=rocketpy --cov-report=xml
cd rocketpy
pytest --doctest-modules --cov=rocketpy --cov-report=xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3

- name: Cache Python dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-tests.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- 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

- name: Run Unit Tests
run: pytest tests/unit --cov=rocketpy

- name: Run Integration Tests
run: pytest $(find tests -maxdepth 1 -name "*.py") --cov=rocketpy --cov-append

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

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

- name: Upload coverage to artifacts
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage.xml

CodecovUpload:
needs: Pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all coverage reports
uses: actions/download-artifact@v2
- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml, ./rocketpy/coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true
files: |
coverage.xml
29 changes: 29 additions & 0 deletions .github/workflows/upload-to-codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload to Codecov

on:
workflow_call:
inputs:
codecov_token:
required: true
type: string
os:
required: true
type: string
python:
required: true
type: string

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ inputs.codecov_token }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
files: ./coverage.xml, ./rocketpy/coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MANIFEST
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
# Unit test / coverage reports / lints reports
htmlcov/
.tox/
.nox/
Expand All @@ -50,6 +50,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
.pylint-report.txt

# Translations
*.mo
Expand Down
26 changes: 26 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,31 @@ function-naming-style=snake_case
# Good variable names which should always be accepted, separated by a comma.
good-names=FlightPhases,
WindroseAxes,
barometric_height_ISA,
grain_I_33_initial,
convert_units_Functions,
Ix_volume,
Iy_volume,
Iz_volume,
Kn,
Kn_source,
I_dot,
I_CM,
Rdot,
Dx,
Dy,
Dz,
requires_netCDF4,
I_11_without_motor,
I_22_without_motor,
I_33_without_motor,
I_12_without_motor,
I_13_without_motor,
I_23_without_motor,
HTML,
fin_set_NACA,
fin_set_E473,
HIRESW_dictionary,


# Good variable names regexes, separated by a comma. If names match any regex,
Expand Down Expand Up @@ -436,6 +461,7 @@ disable=raw-checker-failed,
no-else-return,
inconsistent-return-statements,
unspecified-encoding,
no-member, # because we use funcify_method decorator

# 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
Loading

0 comments on commit 9055923

Please sign in to comment.