Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add poetry and fix problem from #23 #25

Merged
merged 44 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c9c3efa
Add poetry, all configs and dependences now are in pyproject.toml, pc…
Jun 5, 2022
cc394fb
Fix: Dependencies versions
Jun 5, 2022
3dabd25
Feature: Scratch files to document the project
Jun 5, 2022
697ade8
Feature: Improve CI/CD with poetry and removing pyright workaround
Jun 5, 2022
1a2c94f
Fix: Add black and isort in dependencies
Jun 5, 2022
7176fd0
Feature: Add a script to run all tests, just type "poetry run all_test"
Jun 5, 2022
13b1b19
Feature: Add something in documentations
Jun 6, 2022
ea7e6c4
Merge branch 'main' into feature/poetry
Jun 8, 2022
2de548e
Fix: Project version, Author, Python versions, Pandas version
Jun 8, 2022
8bcb394
Fix: Remove old test file documentation
Jun 8, 2022
cf96463
Fix: Remove old pyright configs
Jun 8, 2022
ec78fab
Fix: Documentation in README.md with links
Jun 8, 2022
9f44c9b
Fix: pyproject.toml python compatibility
Jun 8, 2022
34ec92a
Fix: Add tests with wheel
Jun 8, 2022
728e449
Fix: Remove pytests from tests against dist
Jun 8, 2022
7871b94
Fix: Remove Source code distribution on tests after install wheel
Jun 8, 2022
e5040a4
Fix: Using shutil to remove dir
Jun 8, 2022
9259b96
Fix: Improve local tests and fix CI tests
Jun 8, 2022
8d05d17
Fix: Add metadata to pyproject.toml when build a wheel
Jun 8, 2022
34c8305
Fix: Replace default "poetry.scripts" equivalent to console_scripts f…
Jun 8, 2022
b9677bd
Fix: Improving docs with instructions to update dependencies "poetry …
Jun 9, 2022
13d738d
Fix: Split Dev from Dist Dependencies
Jun 10, 2022
b646c9a
Refactor: Util test scripts
Jun 10, 2022
0e3ea0a
CI: All tests call poe to run
Jun 10, 2022
fbff5dc
Docs: Improving setup and test documentation
Jun 10, 2022
ce3a4f5
Refactor: Improving test_src (I still think it could be better)
Jun 10, 2022
b398255
Docs: Improving poe tests documentation
Jun 10, 2022
40836f2
Style: Apply black and isort to new scripts code
Jun 10, 2022
3cf7947
Fix: Bug when test_src code fails, test_dist continues to test
Jun 10, 2022
38a64d6
Fix: Error in test documentation
Jun 10, 2022
54a846a
Docs: Improving CLI help documentation to run tests
Jun 10, 2022
36fc564
Docs: Improving CLI help documentation to run tests
Jun 10, 2022
0f73192
CI: Runs CI only when change code or dependencies
Jun 10, 2022
1d73e23
Docs: Fix Mc Donald's english errors
Jun 10, 2022
fe21dd2
Fix: Package test
Jun 12, 2022
bc550a6
Fix: Package Test
Jun 12, 2022
d4467e0
CI: Fix package test
Jun 12, 2022
0f4eb0b
Fix: add project to sys path
Jun 12, 2022
5a17251
Refactor: Folder Hierarquie, Rollback job, refresh setup docs
Jun 14, 2022
5667178
Fix: Add rollback to test_dist
Jun 14, 2022
4c6d838
Feature: Add code style check
Jun 14, 2022
ba94941
Refactor: Improving rollback
Jun 14, 2022
3abae80
Feature: add clean cache option in local tests
Jun 14, 2022
0aaeadb
Fix: code style check
Jun 14, 2022
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
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,26 @@ jobs:
- name: Upgrade pip
run: |
python -m pip install --upgrade pip

- name: Install Poetry and project dependencies
run: |
pip install poetry
poetry install

- name: Run Pyright
run: poetry run pyright

- name: Run Pytest
run: poetry run pytest

- name: Run MyPy
run: poetry run mypy pandas-stubs tests
run: poetry run mypy pandas-stubs tests

- name: Install wheel
run: poetry run install_wheel

- name: Run Pyright against dist
breno-jesus-fernandes marked this conversation as resolved.
Show resolved Hide resolved
run: poetry run pyright

- name: Run MyPy against dist
run: poetry run mypy tests
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
all_tests = "scripts.tests:test_all"
all_tests = "scripts.tests:run_all"
install_wheel = "scripts.tests:install_wheel"

[tool.black]
line_length = 88
Expand Down
40 changes: 36 additions & 4 deletions scripts/tests.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
import subprocess
from pathlib import Path


def test_all():
def __test_all():
cmd = ["mypy", "pandas-stubs", "tests"]
subprocess.run(cmd)

cmd = ["pytest"]
subprocess.run(cmd)

cmd = ["pyright"]
subprocess.run(cmd)


def install_wheel():
cmd = ["poetry", "build", "-f", "wheel"]
subprocess.run(cmd)

path = next(Path("dist/").glob("*.whl"))
cmd = ["pip", "install", str(path)]
subprocess.run(cmd)


cmd = ['mypy', 'pandas-stubs', 'tests']
def __clean_env():
cmd = ["pip", "uninstall", "-y", "pandas-stubs"]
subprocess.run(cmd)

cmd = ['pytest']
cmd = ["poetry", "install"]
subprocess.run(cmd)

cmd = ['pyright']

def run_all():

__test_all()

install_wheel()

cmd = ["pyright"]
subprocess.run(cmd)

cmd = ["mypy", "tests"]
subprocess.run(cmd)

__clean_env()