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

Remove old build files and make python 3.11 work #415

Merged
merged 10 commits into from
Jul 20, 2023
Merged

Conversation

matko
Copy link
Member

@matko matko commented Jul 19, 2023

This removes all of the old build system in favor of poetry.
We were still installing the tdbpy tool using the old build script, and maintaining two separate lists of dependencies where tox used a weird mix of both. This only retains poetry.

@matko matko marked this pull request as draft July 19, 2023 11:38
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #415 (64917b6) into main (bd04fff) will increase coverage by 7.51%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #415      +/-   ##
==========================================
+ Coverage   71.61%   79.12%   +7.51%     
==========================================
  Files          43       62      +19     
  Lines        4101     5730    +1629     
==========================================
+ Hits         2937     4534    +1597     
- Misses       1164     1196      +32     
Impacted Files Coverage Δ
terminusdb_client/schema/schema.py 79.20% <100.00%> (+0.39%) ⬆️
terminusdb_client/tests/test_Schema.py 95.72% <100.00%> (ø)

... and 18 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@matko
Copy link
Member Author

matko commented Jul 19, 2023

While working on this I saw that 3.11 unfortunately introduced some changes that caused parts of the codegen to fail. Since i have no time to investigate now, the PR currently just sets the max supported version to 3.10.

@matko matko changed the title Remove old build files Remove old build files and make python 3.11 work Jul 19, 2023
commands =
#shed # combines autoflake, black, isort, and pyupgrade
flake8

[testenv:test]
[testenv]
Copy link
Member Author

Choose a reason for hiding this comment

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

note to future reviewer: the reason I removed the :test here is because by making the test run the default environment, every other environment inherits it. The practical consequence of this is that you can do tox -e test-py39 to test against python 3.9, and similar for other versions, without actually having to make environments for every individual python version. Very convenient during development IMO.

One disadvantage is that by declaring it as such, the check environment also inherits the settings here, except for those fields that it overrides. The only consequence in this config is that that means that the TERMINUSX_TOKEN is also passed to flake8, who completely ignores it. But something to keep in mind.

@matko matko marked this pull request as ready for review July 19, 2023 22:26
commands =
pip install -e .
python -m pytest --tb=native --cov=terminusdb_client terminusdb_client/tests/{posargs} --cov-report xml:cov.xml
passenv = TERMINUSX_TOKEN


[testenv:deps]
Copy link
Member Author

Choose a reason for hiding this comment

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

all of this was incredibly evil.
The whole point of a build system is to have a single authority for how the build is done. Tox already uses the normal build (through pip install), and yet here we're messing with an entirely different set of requirement files. Pointless and confusing at best, widely divergent at worst.

# Settings for other tools
[flake8]
# S501 is turned off for now, check if the verify=false for request is ok
ignore = E501,W503,S101,S310,A003,E203,S607,S603,S404,W391,N814,N804,S106,F722,S105,E266,S311,N806
exclude = .*/,__pycache__,docs/,build/

Copy link
Member Author

Choose a reason for hiding this comment

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

isort is now configurable through the pyproject.toml file, which imo is better.

I'd have liked to move everything there. Unfortunately, flake8 cannot yet do it. Therefore there's still a flake8 section above.

@rrooij rrooij merged commit 0251f80 into main Jul 20, 2023
14 checks passed
@rrooij rrooij deleted the remove_old_build_files branch July 20, 2023 08:10
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.

3 participants