-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add poetry, all configs and dependences now are in pyproject.toml, pckg structure now follows pep 561 * Fix: Dependencies versions * Feature: Scratch files to document the project * Feature: Improve CI/CD with poetry and removing pyright workaround * Fix: Add black and isort in dependencies * Feature: Add a script to run all tests, just type "poetry run all_test" * Feature: Add something in documentations * Fix: Project version, Author, Python versions, Pandas version * Fix: Remove old test file documentation * Fix: Remove old pyright configs * Fix: Documentation in README.md with links * Fix: pyproject.toml python compatibility * Fix: Add tests with wheel * Fix: Remove pytests from tests against dist * Fix: Remove Source code distribution on tests after install wheel * Fix: Using shutil to remove dir * Fix: Improve local tests and fix CI tests * Fix: Add metadata to pyproject.toml when build a wheel * Fix: Replace default "poetry.scripts" equivalent to console_scripts from setuptools to "poe" a poetry plugin to run util scripts. * Fix: Improving docs with instructions to update dependencies "poetry update". * Fix: Split Dev from Dist Dependencies * Refactor: Util test scripts * CI: All tests call poe to run * Docs: Improving setup and test documentation * Refactor: Improving test_src (I still think it could be better) * Docs: Improving poe tests documentation * Style: Apply black and isort to new scripts code * Fix: Bug when test_src code fails, test_dist continues to test * Fix: Error in test documentation * Docs: Improving CLI help documentation to run tests * Docs: Improving CLI help documentation to run tests * CI: Runs CI only when change code or dependencies * Docs: Fix Mc Donald's english errors * Fix: Package test * Fix: Package Test * CI: Fix package test * Fix: add project to sys path * Refactor: Folder Hierarquie, Rollback job, refresh setup docs * Fix: Add rollback to test_dist * Feature: Add code style check * Refactor: Improving rollback * Feature: add clean cache option in local tests * Fix: code style check Co-authored-by: Breno Fernandes <brenojesusfernandes@pm.com>
- Loading branch information
1 parent
2eba4d4
commit f2b783c
Showing
199 changed files
with
477 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,62 @@ | ||
name: 'Test' | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
on: | ||
push: | ||
paths: | ||
- /**/*.py | ||
- /**/*.pyi | ||
- pyproject.toml | ||
- .github/workflows/test.yml | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.8', '3.9', '3.10'] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | ||
python -m pip install -r tests/requirements.txt | ||
|
||
- name: Run pyright tests | ||
uses: gramster/pyright-action@main | ||
with: | ||
project: pyrighttestconfig.json | ||
warn-partial: true | ||
|
||
- name: Run pytest | ||
run: | ||
pytest tests/pandas | ||
|
||
- name: Run mypy | ||
run: | ||
mypy tests/pandas typings/pandas | ||
|
||
- name: Build wheel and install and remove typings | ||
run: | | ||
python setup.py build bdist_wheel | ||
find ./dist/*.whl | xargs pip install | ||
rm -rf typings | ||
pip install pyright | ||
- name: Run pyright against dist | ||
uses: gramster/pyright-action@main | ||
with: | ||
project: pyrightdistconfig.json | ||
warn-partial: true | ||
|
||
- name: Run mypy against dist | ||
run: | ||
mypy tests/pandas | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
|
||
- name: Install Poetry | ||
run: pip install poetry | ||
|
||
- name: Install project dependencies | ||
run: poetry install -vvv --no-root | ||
|
||
- name: Run MyPy Against Source Code | ||
run: poetry run poe run_mypy_src | ||
|
||
- name: Run Pyright Against Source Code | ||
run: poetry run poe run_pyright_src | ||
|
||
- name: Run Pytest Against Source Code | ||
run: poetry run poe run_pytest_src | ||
|
||
- name: Build Distribution | ||
run: poetry run poe build_dist | ||
|
||
- name: Install Distribution | ||
run: poetry run poe install_dist | ||
|
||
- name: Remove Source Code | ||
run: poetry run poe remove_src | ||
|
||
- name: Run Pyright Against Distribution | ||
run: poetry run poe run_pyright_dist | ||
|
||
- name: Run MyPy Against Distribution | ||
run: poetry run poe run_mypy_dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,5 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
/poetry.lock | ||
.ideia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Set Up Environment | ||
|
||
- Make sure you have `python >= 3.8` installed. </br></br> | ||
- Install poetry if you still don't have: </br> `pip install poetry`</br> </br> | ||
- Install the project dependencies with: </br> `poetry update -vvv` </br></br> | ||
- Enter the virtual environment: </br> `poetry shell`</br></br> | ||
- Run all tests to make sure the project is ok: </br> `poe test_all` </br></br> | ||
- Do you want to add a new dependency? </br> `poetry add --dev foo-pkg ` </br></br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Test | ||
|
||
- Run local tests against source code. </br> `poe test_src` </br> </br> | ||
- Profiles: </br> | ||
- Default: Runs only mypy and pyright tests </br> `poe test_src --profile=default` </br> | ||
- Pytest: Runs only pytest </br> `poe test_src --profile=pytest` </br> | ||
- Full: Run all tests (mypy, pyright and pytests) </br> `poe test_src --profiel=full` </br> </br> | ||
|
||
- Run local tests against distribution: </br> `poe test_dist` </br> </br> | ||
|
||
- Run all local tests: </br> `poe test_all` </br> </br> | ||
|
||
- Forgot some command? </br>`poe --help` </br> </br> | ||
|
||
- These tests originally came from https://github.com/VirtusLab/pandas-stubs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Code style | ||
|
||
- It's important to follow the code style from the project: | ||
- poetry run black pandas-stubs tests scripts | ||
- poetry run isort pandas-stubs tests scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Security | ||
|
||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Publish | ||
|
||
You know ... just type "poetry publish pandas-stubs" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import sys | ||
|
||
from loguru import logger | ||
from pathlib import Path | ||
|
||
pkg_path = [x for x in sys.path if x.endswith('site-packages')] | ||
|
||
if not Path(fr'{pkg_path[0]}/my_paths.pth').exists(): | ||
with open(fr'{pkg_path[0]}/my_paths.pth', 'w') as file: | ||
file.write(str(Path.cwd())) | ||
|
||
|
||
config = { | ||
"handlers": [ | ||
{ | ||
"sink": sys.stderr, | ||
"format": ( | ||
"<level>\n" | ||
"===========================================\n" | ||
"{message}\n" | ||
"===========================================\n" | ||
"</level>" | ||
), | ||
} | ||
] | ||
} | ||
|
||
logger.configure(**config) |
Oops, something went wrong.