Skip to content
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

Update automated tests, pass as-is #301

Merged
merged 24 commits into from
Nov 6, 2024

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Nov 21, 2023

Work towards #296

Counterpart to #302 but this only touches configurations and infra. No stub change here except for stubs/scipy-stubs/optimize/cython_optimize/__init__.pyi (which is purely a mypy workaround otherwise it wouldn't even run due to same-name modules). So you can decide which you want first. There will be slight conflicts but I'll resolve them.

  • Add mypy, isort and black tests to GitHub actions
  • Move pyright configs to be automatically picked up by Editor, CLI and CI
  • Move typeCheckingMode setting from IDE only to pyright configs
  • Move warn-partial setting from GitHub actions to pyright configs
  • Remove redundant default mypy settings
  • Turn on show_column_numbers in mypy
  • Bump minimum supported version to 3.8
  • Ignore existing errors (preferably as warnings) and mark them as TODO
  • Exclude/skip files where the error cannot be globally ignored, and mark them as TODO
  • Remove empty tests/__init__.py
  • Add stubs/scipy-stubs/optimize/cython_optimize/__init__.pyi to get mypy to run
  • Added all parent libraries needed to validate typing in tests/requirements.txt
  • Use pyright-python's PYRIGHT_PYTHON_PYLANCE_VERSION to ensure better sync with Pylance
  • Converge tests/run_tests.sh and tests/run_tests.cmd into a Python script, simplified the commands, and update to run all the tests
  • Added tests/run_formatters.py to run all code fixers and formatters

tests/run_tests.sh Outdated Show resolved Hide resolved
@Avasam Avasam requested a review from debonte August 11, 2024 01:56
tests/run_tests.cmd Outdated Show resolved Hide resolved
tests/requirements.txt Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@Avasam Avasam requested a review from debonte August 12, 2024 00:30
@Avasam
Copy link
Contributor Author

Avasam commented Aug 12, 2024

Updated with latest review comments! Btw feel free to squash commit once this is accepted. I avoid rebases/force-pushes on GitHub to make it easier on the reviewer to see latest changes.

pyproject.toml Outdated Show resolved Hide resolved
@debonte
Copy link
Contributor

debonte commented Nov 5, 2024

What is the status of this PR?

@Avasam
Copy link
Contributor Author

Avasam commented Nov 5, 2024

What is the status of this PR?

Unless you have any other comment, it's good to be squash-merged on my side if it passes the CI. #301 (comment) and #301 (comment) are more follow-ups than something to be done here.

@Avasam
Copy link
Contributor Author

Avasam commented Nov 6, 2024

The conflict is caused by:
The user requested typing_extensions==4.2.0
mypy 1.11.2 depends on typing-extensions>=4.6.0
The user requested typing_extensions==4.2.0
mypy 1.11.1 depends on typing-extensions>=4.6.0
The user requested typing_extensions==4.2.0
mypy 1.11.0 depends on typing-extensions>=4.6.0

I unpinned typing_extensions to just follow what mypy uses

matplotlib
mypy==0.950
# Tools used for testing
docopt-ng
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When installing the requirements on a fresh install of Python 3.10, I got the following warning:
DEPRECATION: docopt is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

That led me to docopt/docopt#502 (comment): even docopt organization members are recommending to switch over to docopt-ng due to docopt being unmaintained in the past 6 years (last release 10 years ago)

@debonte debonte merged commit f33aa54 into microsoft:main Nov 6, 2024
3 checks passed
@debonte
Copy link
Contributor

debonte commented Nov 6, 2024

@Avasam, thanks for your work here!

@Avasam Avasam deleted the Update-automated-tests branch November 6, 2024 23:50
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