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

Addresses #28, #37 moved main files to src folder. Testing and sphinx… #49

Merged
merged 6 commits into from
Nov 14, 2022

Conversation

maltevogl
Copy link
Member

What should work?

  • installing via pip install -U .
  • Testing via tox
  • Creating docs locally via tox -e docs

In principle ready for readthedocs (see yaml)

@maltevogl
Copy link
Member Author

There might be changes necessary in the CI, since the package is now in a subfolder. This is somehow necessary? for setup.cfg

@rlskoeser
Copy link
Member

@maltevogl it looks like the CI is failing because the path we were using for caching python deps has changed, I think you need to change it from the setup.py to the new setup.cfg in both the check and unit test workflows:

    cache-dependency-path: **/setup.py

Copy link
Member

@rlskoeser rlskoeser left a comment

Choose a reason for hiding this comment

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

Thanks for doing all of this! Great to see. I was able to install locally, run tests with tox, and generate docs with tox – very nice!

Thanks for updating the readme; do you think we need any more details? (e.g., any problems if we still run tests with pytest instead of tox? what do we lose?) I guess when you generate the docs it gives you the path to view them.

I don't typically use tox on my projects, can you briefly state the value? I didn't know you could use it to build docs or run other commands, that seems convenient. (I only knew of it for running matrix-style testing on different versions locally.)

Do we want support for a matrix build with tox, and if so can we synchronize the python versions we're testing on GitHub Actions? (I'm not sure if this is worth the effort/time, I'm fine with running one version locally).

I think this generally looks good and we can probably merge once the checks are passing.

@@ -13,7 +13,7 @@
ONE_DAY = datetime.timedelta(days=1)


class Undate:
class Undate():
Copy link
Member

Choose a reason for hiding this comment

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

I thought () wasn't needed anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am just old school, I guess. We can remove them

Copy link
Member

Choose a reason for hiding this comment

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

I am too, trying to train myself not to do this style class Undate(Object): any more

@rlskoeser
Copy link
Member

Do we still need a minimal setup.py for any legacy tooling? I thought I saw that somewhere in the docs but now I'm not seeing it.

README.md Outdated Show resolved Hide resolved
@maltevogl
Copy link
Member Author

I do not know how to change the CI for a PR only. Can someone look at this?

@rlskoeser
Copy link
Member

I do not know how to change the CI for a PR only. Can someone look at this?

This is the syntax for making a step conditional so it only applies to pull requests:

    if: ${{ github.event_name == 'pull_request' }}

Which step needs to be made conditional for PRs only? I think the caching step change applies to all events.

Would be glad to help if you can provide more specifics about what you think is needed.

@ColeDCrawford
Copy link
Collaborator

@rlskoeser re setup.py, I think some tooling may still rely on it but can't remember what. The whole file can be this:

import setuptools
if __name__ == "__main__":
    setuptools.setup()

@rlskoeser
Copy link
Member

@rlskoeser re setup.py, I think some tooling may still rely on it but can't remember what. The whole file can be this:

import setuptools
if __name__ == "__main__":
    setuptools.setup()

Thanks — I saw something like that somewhere in the docs but couldn't find it when I went back to look. That's what I thought — it's super minimal since it relies on the other config files, but still helpful to have it for some cases.

@@ -31,4 +31,4 @@ jobs:
run: pip install -e ".[dev]"
if: steps.python-cache.outputs.cache-hit != 'true'
- name: Run unit tests
run: pytest
run: tox
Copy link
Member

Choose a reason for hiding this comment

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

@ColeDCrawford I don't know how to reconcile tox with the python version test matrix, do you ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like tox-gh-actions worked!

Copy link
Member

Choose a reason for hiding this comment

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

now do we need to specify the python versions in more places? would be nice if we could avoid that duplication somehow (seems redundant to have it in the tox config and also the build matrix). We should put it on the readme at some point, too, but hoping we can use a badge to pull from pypi once we publish.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed, it would be nice to pull the build matrix from tox.ini tox.envlist or setup.cfg, but not sure how to set that up.

ColeDCrawford and others added 2 commits November 14, 2022 10:48
Good suggestion by @rlskoeser

Co-authored-by: Rebecca Sutton Koeser <rlskoeser@users.noreply.github.com>
Copy link
Collaborator

@ColeDCrawford ColeDCrawford left a comment

Choose a reason for hiding this comment

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

Think this looks great, looking forward to seeing docs. Tests are now passing with the updated tox and python matrix.

@rlskoeser
Copy link
Member

Think this looks great, looking forward to seeing docs. Tests are now passing with the updated tox and python matrix.

@ColeDCrawford I don't see the GitHub Actions listed on the PR and the checks tab says there were zero workflow runs — any ideas?

@ColeDCrawford
Copy link
Collaborator

Think this looks great, looking forward to seeing docs. Tests are now passing with the updated tox and python matrix.

@ColeDCrawford I don't see the GitHub Actions listed on the PR and the checks tab says there were zero workflow runs — any ideas?

That is weird. When the tests were failing they appeared at the bottom of the PR, but you're right that I don't see them now. There's also no green check on https://github.com/dh-tech/hackathon-2022/pulls. But if you go to https://github.com/dh-tech/hackathon-2022/actions, you can see all the Actions runs, and this PR passes for both unit tests and style check

@ColeDCrawford
Copy link
Collaborator

Maybe related to the fact that the PR is from maltevogl:main to hackathon-2022 and not a branch of hackathon-2022? Not sure though

@rlskoeser
Copy link
Member

@ColeDCrawford yes, I see the actions passed — very weird. They were showing up before, not sure why they stopped. (Possible your path filter is excluding it on the push, but I would have thought the pull would still run....) Should we just merge it and then deal with it if there are any problems?

@ColeDCrawford ColeDCrawford merged commit 05404f2 into dh-tech:main Nov 14, 2022
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