-
Notifications
You must be signed in to change notification settings - Fork 172
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
[INF] Infra upgrades #1294
[INF] Infra upgrades #1294
Conversation
- Removed unused hooks: isort, flake8 - Added new hook: ruff - Updated black and interrogate hooks configuration - Commented out darglint due to timeout issues on pre-commit CI This update aims to improve code quality checks and ensure consistency across the codebase.
This commit introduces a new feature to the codebase by adding the configuration for the ruff tool in the pyproject.toml file. The configuration includes enabling pycodestyle and Pyflakes codes, allowing fixes for all enabled rules, excluding commonly ignored directories, setting the line length to 88, allowing unused variables when underscore-prefixed, and assuming Python 3.8. It also sets the default complexity level to 10 for the mccabe tool under ruff.
This commit updates the target Python version in the pyproject.toml file from 3.8 to 3.10.
- Python version updated from 3.9 to 3.10 - rdkit version constraint removed
In this commit, the darglint pre-commit hook has been commented out. Additionally, the --fix argument has been added to the ruff pre-commit hook.
🚀 Deployed on https://deploy-preview-1294--pyjanitor.netlify.app |
Due to performance issues, darglint has been commented out in the pre-commit configuration. It may be replaced by ruff in the future. See astral-sh/ruff#458 for more details.
- Updated the version of pre-commit-hooks from v4.4.0 to v4.5.0. - Added pydoclint as an interim replacement for darglint with configuration in pyproject.toml.
Changed the type checking in the skipna function from using type() to isinstance() for better Pythonic practice.
In this commit, we have updated the docstring for the `_get_data_df` method in the `DataDescription` class to provide more detailed information about its functionality. We have also removed the redundant comments from the `__init__` method of the `col` class in `utils.py` as they were not providing any additional value.
@thatlittleboy bang bang! 6.2 seconds for pre-commit hooks check 😄 |
This commit removes the darglint checks workflow from the GitHub actions. The workflow was initially added to run darglint checks manually due to the pre-commit CI timing out. Now that the issue has been resolved, the workflow is no longer needed.
This commit introduces the 'col' utility from the utils module into the janitor package. This utility can now be accessed directly from the janitor package.
- Updated import statement in __init__.py to include DropLabel from functions.utils - Modified usage of expand_grid function in expand_grid.py to be directly called instead of through the janitor module
Ruff supports darglint? That's fantastic |
Not yet! But there is a replacement for it,
|
More power to open source |
This commit removes the test_df_registration.py file, which contained redundant tests for dataframe method registration. These tests were not necessary as the registration of these methods is guaranteed by the pandas-flavor library.
… in test - Added a new function `dynamic_import` in `janitor/utils.py` that allows for dynamic importing of all modules in a directory. - Imported `janitor.chemistry` in `tests/chemistry/test_maccs_keys_fingerprint.py` to ensure it's available during testing. - Also added `importlib` and `pathlib.Path` to `janitor/utils.py` to support the new function.
- Imported dynamic_import from janitor.utils - Called dynamic_import function with __name__ as argument
- In `janitor/functions/__init__.py`, the argument passed to `dynamic_import` has been updated from `__name__` to `Path(__name__)` to leverage the pathlib library for more robust path handling. - In `tests/functions/test_conditional_join.py`, the number of examples for several tests has been limited to improve test performance and reduce runtime.
… function This commit removes the unused imports 'Path' from 'pathlib' and 'dynamic_import' from 'janitor.utils'. It also removes the call to 'dynamic_import' function which is no longer needed.
- Modified the import statements in test_expand_grid.py and test_factorize_columns.py to include the janitor module. - This change ensures that the janitor module is explicitly imported in the test files.
This commit adds an import statement for the janitor module in the test_fill_direction.py file. This is necessary for the proper functioning of the tests in this file.
This commit reorganizes the function imports in the janitor package to improve code readability and maintainability. It also removes an unused import from the main __init__.py file.
Codecov Report
@@ Coverage Diff @@
## dev #1294 +/- ##
==========================================
- Coverage 97.20% 94.27% -2.93%
==========================================
Files 78 78
Lines 4114 4125 +11
==========================================
- Hits 3999 3889 -110
- Misses 115 236 +121 |
@samukweku I think we're good to go here! The patch target is lower, but at least we've got the project coverage up. |
This commit reduces the maximum number of examples generated by pytest for each test case from unlimited to 10. This change is intended to speed up test execution time without significantly reducing test coverage.
In an effort to optimize testing time, the maximum number of examples for each test in the pytest settings has been reduced to 10. This change affects multiple test functions in the 'test_conditional_join.py' file.
@samukweku I did one other thing to speed up the turtle tests: we only run 10 examples now, rather than the usual 100. That should substantially cut down on the iteration time needed to get feedback on the CI system |
I guess in general, if a Hypothesis-based test takes >1 second to run, we should drop the max number of examples on that test to 10. |
This commit expands the "Write the Code" section in the developer guide. It provides more detailed instructions on best practices for writing code, including committing early and often, staying updated with the dev branch, and writing tests. It also updates the "Check your code" section to include information about pre-commit hooks.
This commit updates the version of the checkout action used in the GitHub Actions workflow from v3 to v4. It also removes the matrix strategy for running tests, which previously included "turtle" and "not turtle" subsets. Now, all tests will be run without any subset specification.
This commit introduces a new test for the conditional_join function in the test_conditional_join.py file. The test uses an example directly from the conditional_join docstring to verify the function's correct operation.
Okie dokes, everyone, ready for review. Most of the changes don't need to be reviewed, I think (it's just a matter of taking test times down by reducing the number of examples Hypothesis generates), but the others that are infrastructure-related, particularly:
are ready for review. Tagging @thatlittleboy @Zeroto521 and @samukweku for review please! |
PR Description
Please describe the changes proposed in the pull request:
This PR resolves #1236.
PR Checklist
Please ensure that you have done the following:
<your_username>
:dev
, but rather from<your_username>
:<feature-branch_name>
.AUTHORS.md
.CHANGELOG.md
under the latest version header (i.e. the one that is "on deck") describing the contribution.Automatic checks
There will be automatic checks run on the PR. These include:
Relevant Reviewers
Please tag maintainers to review.