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

Modernize testing/linting configuration #65

Merged
merged 1 commit into from
Nov 1, 2021

Conversation

wbolster
Copy link
Member

This simplifies and modernizes the configuration for various testing and
linting tools. Use pyproject.toml as the central location for all
configuration as much as possible.

Details:

  • Move pytest config to pyproject.toml (modern location)
  • Move mypy config to pyproject.toml (modern location)
  • Move unit test files into already existing tests/ dir;
    use importable and recognized-by-default-by-pytest names.
  • Remove seemingly unnecessary coveragerc file; it seemed mostly
    old and outdated copy/paste of boilerplate.
  • Move tool config out of CI config files as much as possible (coverage
    report filenames etc) which is not only cleaner but also better for
    local development because it will use the same settings.
  • make yamllint happy about all yaml/yml files

@wbolster wbolster requested review from dbrgn and francium October 29, 2021 22:09
@wbolster wbolster self-assigned this Oct 29, 2021
@wbolster wbolster marked this pull request as draft October 29, 2021 22:10
@francium
Copy link
Member

Great work @wbolster 👍

@wbolster
Copy link
Member Author

thanks, still polishing a bit, hence the draft status.

i'd like to fold in all mypy config, including excludes, into pyproject.toml but it seems i'm doing something wrong or mypy has a bug in its discovery mechanism.

@wbolster wbolster force-pushed the pyproject-toml-tools branch from 030c263 to 6e76299 Compare October 29, 2021 22:31
@wbolster
Copy link
Member Author

urgh 🙄 it turned out that

exclude = ["something.py"]

in pyproject.toml defines a list of strings, which i assumed would work.

however it seems that:

  • mypy (i think) silently stringifies it into the string ["something.py"],
  • then uses it as a regular expression pattern,
  • this happens to be valid syntax for ‘any of the characters in between the [ and ]
  • this matched and hence excluded all discovered files
  • result in an error that no files were checked

computers were a mistake hehe 🙈

@wbolster wbolster marked this pull request as ready for review October 29, 2021 22:35
@wbolster wbolster force-pushed the pyproject-toml-tools branch from 6e76299 to d7da737 Compare October 29, 2021 22:37
@wbolster
Copy link
Member Author

ok, all good it seems 👍🏼 pls have a look @francium (no rush) 🙏🏼

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
@wbolster wbolster force-pushed the pyproject-toml-tools branch from d7da737 to 480eb35 Compare October 30, 2021 18:44
@codecov-commenter
Copy link

Codecov Report

Merging #65 (480eb35) into master (71afad2) will decrease coverage by 2.09%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##            master      #65      +/-   ##
===========================================
- Coverage   100.00%   97.91%   -2.09%     
===========================================
  Files            3        4       +1     
  Lines          227      239      +12     
===========================================
+ Hits           227      234       +7     
- Misses           0        5       +5     
Impacted Files Coverage Δ
tests/test_result.py 100.00% <ø> (ø)
result/result.py 97.14% <0.00%> (-2.86%) ⬇️
setup.py 0.00% <0.00%> (ø)

@wbolster
Copy link
Member Author

i think i addressed all feedback

@wbolster wbolster mentioned this pull request Oct 30, 2021
2 tasks
Copy link
Member

@francium francium left a comment

Choose a reason for hiding this comment

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

Just one small thing. Otherwise, great!

pyproject.toml Outdated Show resolved Hide resolved
This simplifies and modernizes the configuration for various testing and
linting tools. Use pyproject.toml as the central location for all
configuration as much as possible.

Details:

- Move pytest config to pyproject.toml (modern location)
- Move mypy config to pyproject.toml (modern location)
- Move unit test files into already existing tests/ dir;
  use importable and recognized-by-default-by-pytest names.
- Remove seemingly unnecessary coveragerc file; it seemed mostly
  old and outdated copy/paste of boilerplate.
- Move tool config out of CI config files as much as possible (coverage
  report filenames etc) which is not only cleaner but also better for
  local development because it will use the same settings.
- make yamllint happy about all yaml/yml files
@wbolster wbolster force-pushed the pyproject-toml-tools branch from 480eb35 to 4521666 Compare November 1, 2021 08:49
@wbolster wbolster merged commit f8f0bd2 into rustedpy:master Nov 1, 2021
@wbolster wbolster deleted the pyproject-toml-tools branch November 1, 2021 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants