Skip to content

Commit ced6429

Browse files
authored
Merge pull request #19 from RocketPy-Team/mnt/apply-pylint
2 parents e4f16cb + f302cf0 commit ced6429

27 files changed

+356
-372
lines changed

.github/workflows/linter.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Linter
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.9"]
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install pylint
21+
pip install -r requirements.in
22+
- uses: psf/black@stable
23+
with:
24+
options: "--check ."
25+
jupyter: true
26+
- name: Run pylint
27+
run: |
28+
pylint rocketserializer/

.github/workflows/test-pytest.yaml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
1-
name: PyTest
1+
name: pytest
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, ready_for_review]
66
paths:
77
- "**.py"
8+
- ".github/**"
9+
- "pyproject.toml"
10+
- "requirements*"
811

912
jobs:
1013
run_pytest:
1114
runs-on: ${{ matrix.os }}
1215
strategy:
1316
matrix:
14-
os:
15-
- ubuntu-latest
16-
python-version:
17-
- 3.8
17+
os: [ubuntu-latest, windows-latest]
18+
python-version: [3.8, 3.12]
19+
env:
20+
OS: ${{ matrix.os }}
21+
PYTHON: ${{ matrix.python-version }}
1822
steps:
1923
- uses: actions/checkout@v4
2024
- name: Set up Python ${{ matrix.python-version }}
2125
uses: actions/setup-python@v2
2226
with:
2327
python-version: ${{ matrix.python-version }}
24-
- name: Install dependencies
28+
- name: Build package
2529
run: |
2630
python -m pip install --upgrade pip
27-
pip install -r requirements-dev.txt
28-
- name: Build Package
31+
pip install .
32+
- name: Import package
2933
run: |
30-
pip install -e .
31-
- name: Test with pytest
34+
python -c "import sys, rocketserializer; print(f'{rocketserializer.__name__} running on Python {sys.version}')"
35+
- name: Install dev dependencies
3236
run: |
33-
pytest
37+
pip install -r requirements-dev.txt
38+
# - name: Run pytest
39+
# run: |
40+
# pytest

pyproject.toml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[build-system]
2+
requires = ["setuptools >= 61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools.dynamic]
6+
dependencies = {file = ["requirements.in"]}
7+
8+
[tool.setuptools]
9+
packages = { find = { where = ["."], include = ["rocketserializer*"] } }
10+
11+
[project]
12+
name = "rocketserializer"
13+
version = "0.1.0"
14+
dynamic = ["dependencies"]
15+
requires-python = ">= 3.8"
16+
description = "Easily convert your OpenRocket files into RocketPy simulations."
17+
readme = "README.md"
18+
license = {file = "LICENSE.md"}
19+
authors = [
20+
{name = "Guilherme Fernandes", email = "guilherme_fernandes@usp.br"},
21+
{name = "Patrick Sampaio", email = "patricksampaio@usp.br"},
22+
{name = "Julio Machado", email = "julioromac@outlook.com"},
23+
]
24+
maintainers = [
25+
{name = "RocketPy Team", email = "rocketpyteam@gmail.com"},
26+
]
27+
keywords = [
28+
"python",
29+
"simulation",
30+
"aerospace",
31+
"motor",
32+
"flight-simulator",
33+
"trajectory",
34+
"trajectory-simulator",
35+
"rocket-simulator",
36+
"openrocket",
37+
"rocket-simulation",
38+
]
39+
classifiers = [
40+
"Programming Language :: Python :: 3.8",
41+
"Programming Language :: Python :: 3.9",
42+
"Programming Language :: Python :: 3.10",
43+
"Programming Language :: Python :: 3.11",
44+
"Programming Language :: Python :: 3.12",
45+
]
46+
47+
[project.scripts]
48+
ork2json = "rocketserializer.cli:ork2json"
49+
ork2ipynb = "rocketserializer.cli:ork2ipynb"
50+
51+
52+
[project.urls]
53+
Documentation = "https://docs.rocketpy.org/en/latest/"
54+
Repository = "https://github.com/RocketPy-Team/RocketSerializer"
55+
Issues = "https://github.com/RocketPy-Team/RocketSerializer/issues"
56+
57+
58+
[tool.black]
59+
line-length = 88
60+
61+
62+
[tool.isort]
63+
profile = "black"
64+
65+
66+
[tool.pylint]
67+
max-line-length = 88
68+
disable = """
69+
missing-module-docstring,
70+
missing-function-docstring,
71+
missing-class-docstring,
72+
attribute-defined-outside-init,
73+
too-many-locals,
74+
too-many-arguments,
75+
too-many-statements,
76+
raise-missing-from,
77+
fixme,
78+
no-else-break,
79+
"""

requirements.txt

Lines changed: 0 additions & 110 deletions
This file was deleted.
File renamed without changes.

open_rocket_serializer/_helpers.py renamed to rocketserializer/_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def extract_ork_from_zip(zip_path: Path, extract_dir: Path) -> Path:
4646
return extract_dir / "rocket.ork"
4747
except BadZipFile:
4848
logger.warning(
49-
'The file "%s" seems to be a direct .ork file and not a compressed archive.',
49+
'The file "%s" seems to be a rocket.ork file and not a compressed archive.',
5050
zip_path.as_posix(),
5151
)
5252
return zip_path
@@ -112,7 +112,7 @@ def _dict_to_string(dictionary, indent=0):
112112
113113
Examples
114114
--------
115-
>>> from open_rocket_serializer._helpers import _dict_to_string
115+
>>> from rocketserializer._helpers import _dict_to_string
116116
>>> _dict_to_string({"a": 1, "b": {"c": 2}})
117117
" a: 1\n b: \n c: 2\n"
118118
"""

0 commit comments

Comments
 (0)