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

MNT: update develop branch with changes from master #461

Merged
merged 37 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8e17379
BUG: cannot print max_acceleration_power_on_time
Gui-FernandesBR Oct 13, 2023
b8194b2
TST: add a test to cover the last bug behavior
Gui-FernandesBR Oct 13, 2023
743f142
Fix code style issues with Black
lint-action Oct 13, 2023
0d00797
Merge pull request #438 from RocketPy-Team/bug/flight-print-max-accel
Gui-FernandesBR Oct 14, 2023
f6ccce3
DOC: better documentation of HibridMotor docstring
Gui-FernandesBR Oct 28, 2023
4733c19
DOC: better documentation of LiquidMotor docstring
Gui-FernandesBR Oct 28, 2023
5387b49
DOC: better documentation of Motor abstract class
Gui-FernandesBR Oct 28, 2023
a26c9c9
DOC: better documentation of SolidMotor class
Gui-FernandesBR Oct 28, 2023
8686524
DOC: fix the "tank mass" terminology
Gui-FernandesBR Oct 28, 2023
575adbe
DOC: improve Rocket class docstrings
Gui-FernandesBR Oct 28, 2023
8eb1a57
ENH: use of f-string in rocket prints
Gui-FernandesBR Oct 28, 2023
c4c8f64
DOC: fix the rocket mass definition in utilities
Gui-FernandesBR Oct 28, 2023
dff8214
TST: remove travis CI file, no longer used
Gui-FernandesBR Oct 29, 2023
88f2798
TST: update workflow to run on new python 3.12
Gui-FernandesBR Oct 29, 2023
4542d9d
ENH: adding docker files
Gui-FernandesBR Oct 29, 2023
243d266
DOC: docker instructions attached to the docs
Gui-FernandesBR Oct 29, 2023
9c8971c
DOC: Add documentation on how to build the RocketPy
Gui-FernandesBR Nov 2, 2023
3b10a35
BUG: Update build_docs.rst link in development
Gui-FernandesBR Nov 3, 2023
3676578
DOCS: change italics to inline code
MateusStano Nov 6, 2023
99d7789
DOCS: add bash code blocks
MateusStano Nov 6, 2023
59f091b
Merge pull request #452 from RocketPy-Team/doc/build-docs-page
Gui-FernandesBR Nov 7, 2023
52f66b5
DOC: accepts commit suggestion
Gui-FernandesBR Nov 8, 2023
56ff690
DOC: accepts commit suggestion
Gui-FernandesBR Nov 8, 2023
ee44405
DOC: accepts commit suggestion
Gui-FernandesBR Nov 8, 2023
3bbe641
Merge branch 'master' into docs/improve_mass_docs
Gui-FernandesBR Nov 9, 2023
8d0169e
DOC: Update dry_mass documentation for all motor
Gui-FernandesBR Nov 9, 2023
1c19506
Merge branch 'master' into tst/update-workflows
Gui-FernandesBR Nov 9, 2023
cf6f977
TST: Add .github/** to paths in test_pytest.yaml
Gui-FernandesBR Nov 9, 2023
8b0800d
MNT: Add Codecov integration to test_pytest.yaml
Gui-FernandesBR Nov 10, 2023
3a46aed
MNT: Add code coverage to pytest workflow
Gui-FernandesBR Nov 10, 2023
c848621
MNT: environment variables with codecov
Gui-FernandesBR Nov 10, 2023
7934beb
DOC: Add codecov badge to README.md
Gui-FernandesBR Nov 10, 2023
8eb039d
DOC: improve docs based on latest review.
Gui-FernandesBR Nov 12, 2023
90d489c
DOC: Update motor classes to include same dry_mass
Gui-FernandesBR Nov 12, 2023
f9ff423
Merge pull request #445 from RocketPy-Team/docs/improve_mass_docs
Gui-FernandesBR Nov 12, 2023
93a062e
Merge pull request #458 from RocketPy-Team/mnt/add-codecov-integration
MateusStano Nov 15, 2023
597a81a
Merge pull request #448 from RocketPy-Team/tst/update-workflows
Gui-FernandesBR Nov 15, 2023
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
46 changes: 46 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Python files
__pycache__/
*.pyc
*.pyo
*.pyd
.Python
db.sqlite3
/db.sqlite3
pip-log.txt
pip-delete-this-directory.txt
.pytest_cache/

# Documentation and Tests
docs/
.coverage
readthedocs.yml
.travis.yml
Makefile

# Binary and Package files
*.egg-info/
*.egg
dist/
build/

# VCS
.git/
.gitignore
.gitattributes
.github/

# IDEs and Editors
.vscode

# Virtual environments
.venv
venv
ENV/
env/

# Others
*.log

# Docker
Dockerfile
.dockerignore
25 changes: 20 additions & 5 deletions .github/workflows/test_pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**.py"
- ".github/**"

jobs:
fail_if_pull_request_is_draft:
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
run_pytest_and_doctest:
pytest_and_doctest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -23,7 +24,10 @@ jobs:
- windows-latest
python-version:
- 3.8
- 3.11
- 3.12
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -44,6 +48,17 @@ jobs:
pip install -r requirements-tests.txt
- name: Test with pytest
run: |
pytest
pytest --cov=rocketpy --cov-report=xml
cd rocketpy
pytest --doctest-modules
pytest --doctest-modules --cov=rocketpy --cov-report=xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
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
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Set base image
# python:latest will get the latest version of python, on linux
# Get a full list of python images here: https://hub.docker.com/_/python/tags
FROM python:latest

# set the working directory in the container
WORKDIR /RocketPy

# Ensure pip is updated
RUN python3 -m pip install --upgrade pip

# Copy the dependencies file to the working directory
COPY requirements.txt .
COPY requirements-tests.txt .

# Install dependencies
# Use a single RUN instruction to minimize the number of layers
RUN pip install \
-r requirements.txt \
-r requirements-tests.txt

# copy the content of the local src directory to the working directory
COPY . .

# command to run on container start
# print the operational system and the python version
CMD [ "python3", "-c", "import platform;import sys; print('Python ', sys.version, ' running on ', platform.platform())" ]

# Install the rocketpy package # TODO: check if I can put this in editable mode
RUN pip install .
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/RocketPy-Team/rocketpy/blob/master/docs/notebooks/getting_started_colab.ipynb)
[![PyPI](https://img.shields.io/pypi/v/rocketpy?color=g)](https://pypi.org/project/rocketpy/)
[![Documentation Status](https://readthedocs.org/projects/rocketpyalpha/badge/?version=latest)](https://docs.rocketpy.org/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/RocketPy-Team/RocketPy/graph/badge.svg?token=Ecc3bsHFeP)](https://codecov.io/gh/RocketPy-Team/RocketPy)
[![Contributors](https://img.shields.io/github/contributors/RocketPy-Team/rocketpy)](https://github.com/RocketPy-Team/RocketPy/graphs/contributors)
[![Chat on Discord](https://img.shields.io/discord/765037887016140840?logo=discord)](https://discord.gg/b6xYnNh)
[![Sponsor RocketPy](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/RocketPy-Team)
Expand Down
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3.8'

services:
python38-linux:
image: python:3.8
volumes:
- .:/app
working_dir: /app
command: bash -c "pip install . && pip install -r requirements-tests.txt && pytest && cd rocketpy && pytest --doctest-modules"
logging:
options:
max-size: "10m"
max-file: "3"

python312-linux:
image: python:3.12
volumes:
- .:/app
working_dir: /app
command: bash -c "pip install . && pip install -r requirements-tests.txt && pytest && cd rocketpy && pytest --doctest-modules"
logging:
options:
max-size: "10m"
max-file: "3"
97 changes: 97 additions & 0 deletions docs/development/build_docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
RocketPy documentation
======================

RocketPy uses `Sphinx <https://www.sphinx-doc.org/>`_ to generate the
documentation.
Sphinx makes it easy to create documentation for Python projects and it is
widely used for Python projects, such as
`NumPy <https://numpy.org/doc/stable/>`_,
`Pandas <https://pandas.pydata.org/docs/>`_ and
`SciPy <https://docs.scipy.org/doc/scipy/>`_.


The `ReadTheDocs <https://about.readthedocs.com/?ref=readthedocs.com>`_ is used
to host the documentation. It is a free service that automatically builds
documentation from your sphinx source files and hosts them for free.

RocketPy official documentation is available at
`https://docs.rocketpy.org <https://docs.rocketpy.org/en/latest/index.html>`_.


How to build the documentation in your local machine
----------------------------------------------------

When you find yourself modifying the documentation files and trying to see the
results, you can build the documentation in your local machine.
This is important to check if the documentation is being generated correctly
before pushing the changes to the repository.

To build the documentation in your local machine, you need to install a set of
requirements that are needed to run the sphinx generator.
All these requirements are listed in the ``requirements.txt`` file inside the
``docs`` folder.

To install the requirements, navigate the terminal to the ``docs`` folder and
run the following command:

.. code-block:: bash

pip install -r requirements.txt

After installing the requirements, you can build the documentation by running
the following command in your terminal:

.. code-block:: bash

make html

The file named ``Makefile`` contains the commands to build the documentation.
The ``make html`` command will generate the documentation in the ``docs/_build/html``
folder.

To see the documentation, open the ``docs/_build/html/index.html`` file in your
browser.

.. note:: Watch out for any warnings or errors that may appear in the terminal
when building the documentation. If you find any, fix them before
pushing the changes to the repository or at least warn the team about
them.

Sometimes you may face problems when building the documentation after several
times of building it.
This may happen because sphinx does not clean the ``docs/_build`` folder before
building the documentation again.
To clean the ``docs/_build`` folder, run the following command in your terminal:

.. code-block:: bash

make clean

After cleaning the ``docs/_build`` folder, you can build the documentation again
by running the ``make html`` command.

If the error persists, it may be related to other files, such as the ``.rst``
files or the ``conf.py`` file.

.. danger:: Do not modify the Makefile or the ``make.bat`` files. These files are
automatically generated by sphinx and any changes will be lost.


How to integrate the documentation with ReadTheDocs
---------------------------------------------------

The documentation is automatically built and hosted by `ReadTheDocs`.
Every time a commit is pushed to the repository, `ReadTheDocs` will build the
documentation and host it automatically.
This includes other branches besides the master branch.
However, the documentation will only be available for the master branch, and you
need to configure the `ReadTheDocs` project to build the documentation for other
branches.

The connection between the GitHub repository and the `ReadTheDocs` project is
already configured and defined in the ``readthedocs.yml`` file, available at the
root of the repository.

.. note:: You need admin permissions to configure the `ReadTheDocs` project. Ask
the team for help if you don't have admin permissions.

Loading