-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support PEP 621 #266
Support PEP 621 #266
Conversation
name: Test | ||
|
||
on: | ||
push: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to split out build and test into two separate workflows? Or if not, split build and test into two separate jobs in this workflow?
Do we want to add any tag and release workflows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this new version there are 3 workflows: test, lint, and release. release (which builds the source and wheel packages and uploads them to PyPI) has been there for some time and I have not changed it here. The lint workflow is what it used to be called pythonapp
. The test workflow is new and replaces the Travis setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes sense.
- name: Install Postgresql | ||
uses: ikalnytskyi/action-setup-postgres@v6 | ||
with: | ||
username: postgres | ||
id: postgres | ||
|
||
- name: Install dependencies | ||
run: | | ||
uv pip install --system -e .[dev] | ||
|
||
- name: Test with pytest | ||
run: | | ||
pytest -s | ||
env: | ||
PGSERVICE: ${{ steps.postgres.outputs.service-name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised the tests just worked with these additions. I can finally delete the outdated ghtests
branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was also surprised that this was fairly simple. I also had to change the DatabaseJanitor
a bit since it has changed in newer versions of pytest_postgresql
but nothing too dramatic.
] | ||
|
||
[tool.ruff] | ||
line-length = 99 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can only dream of line-length = 120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have that discussion for sdssdb
1.0. It should come with a committed VSCode config that sets the editor font size to 8pt.
# only run peewee tests | ||
parser.addoption('--peewee', action='store_true', default=False, | ||
help='Only run tests for peewee dbs') | ||
parser.addoption( | ||
"--peewee", | ||
action="store_true", | ||
default=False, | ||
help="Only run tests for peewee dbs", | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just comment here but no need to change it. This is my other grievance with formatters. Not a fan at all when they split inputs onto new lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a problem right now. We have a linter but not a formatter. My default VSCode config will apply ruff format
on save, which maybe shouldn't for this repo, or should do it only on files that one wants to keep formatted. Something to discuss for 1.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good to me. It's a long needed improvement.
This PR adds support for PEP 621 (a.k.a
pyproject.toml
) and tries to clean up the development environment a bit.What it does:
pyproject.toml
file withsetuptools
as build system and removessetup.cfg
andsetup.py
.pyproject.toml
forruff
,flake8
, andisort
. Theruff
andflake8
configurations are set up to match the same.flake8
file we had. I did some very minor changes to a few files to make bothruff check
andflake8
pass, but most problematic files are still being ignored.What it does NOT do:
poetry
oruv
.black
orruff
).Some of those are discussed in #267.
Closes #251
Closes #67