Skip to content

Remove F401 (unused import) ignores, fix all violations - #943

Open
Mubashir78 wants to merge 1 commit into
enthought:mainfrom
Mubashir78:main
Open

Remove F401 (unused import) ignores, fix all violations#943
Mubashir78 wants to merge 1 commit into
enthought:mainfrom
Mubashir78:main

Conversation

@Mubashir78

Copy link
Copy Markdown

Part of #643

  • Remove 12 unused imports found by ruff F401 across the codebase
  • Remove F401 from all 13 per-file-ignores entries in pyproject.toml
  • Drop per-file-ignores lines that had only F401

- Remove 12 unused imports across the codebase
- Remove F401 from all per-file-ignores in pyproject.toml
- Drop unused per-file-ignores entries for files where only F401 was ignored

Part of enthought#643

@junkmd junkmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've returned to contributing to open source.
Sorry for the delay, but I'll review your PR now.

Comment thread comtypes/_npsupport.py
if self.enabled:
return
# first we have to be able to import numpy
import numpy

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in the comment above, we need to import numpy here to cache it in the Python import system.

By adding # noqa: F401 only to this line, you can remove the setting from pyproject.toml while keeping the import.

Comment thread docs/source/conf.py
import os
import sys

import sphinx_rtd_theme

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might have been necessary for Sphinx.
Please check if the documentation can still be built even if this is removed.

Comment thread comtypes/test/setup.py
import glob
from distutils.core import setup

import py2exe

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration between this project and py2exe might already be broken, but I'd like to keep it as it is for now.
Please also add # noqa: F401 to this line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants