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

Python 3 + CKAN 2.9 + Github Actions #4

Merged
merged 26 commits into from
Jul 12, 2022

Conversation

nickumia-reisys
Copy link
Contributor

Only creating to try and spur github actions into ... action?

@nickumia-reisys
Copy link
Contributor Author

Sorry! This was meant to be a PR into our own fork...

Btw, these tests are to demonstrate that the extension works in CKAN 2.8 and 2.9 😅

@nickumia-reisys
Copy link
Contributor Author

After talking with my team, we wanted to open this up to see if upstream would like the upgraded tests running in CKAN 2.9. The main extension requires no update, but the tests were upgraded to run with pytests. Please let me know if there's any questions!

@amercader
Copy link
Member

We would love some 2.9 tests and GitHub Actions!

We don't want to keep the nose tests and there should be just a test.py file (no tests_2_8_and_above.py). To make sure the same test suite will work across different CKAN versions add a dev-requirements.txt file with pytest-ckan as a requirement (like here) and install them in the workflow. That will install all requirements even in CKAN<2.9.

This PR also includes a lot of files that seem to be project specific. We shouldn't need the .env, docker-compose.yml, Makefile etc files. Github Actions should pull all the images needed, you can check an existing extension for how the test workflow is defined:

https://github.com/ckan/ckanext-dcat/blob/master/.github/workflows/test.yml

@amercader
Copy link
Member

To make sure the same test suite will work across different CKAN versions add a dev-requirements.txt file with pytest-ckan as a requirement (like here) and install them in the workflow.

I see now that you do this here. It's still best to put it on dev-requirements.txt so other developers can use it locally

use latest version of actions and test more ckan versions
Convert to Markdown; remove unnecessary updates; remove local docker testing
reference readme md and mention py3 support
Tests gave error: sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:http
@nickumia-reisys nickumia-reisys changed the title Datagov/local testing Python 3 + CKAN 2.9 + Github Actions Jul 11, 2022
@nickumia-reisys
Copy link
Contributor Author

@amercader Sorry for the unnaturally long wait, but I updated this PR to address your comments from above. Please let me know if there's more work to do!

The Data.gov team was hoping that okfn would create another PyPI release with this new code as well 🚀

@nickumia-reisys
Copy link
Contributor Author

Successful Github Actions

image

Copy link
Member

@amercader amercader left a comment

Choose a reason for hiding this comment

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

This looks great @nickumia-reisys !
Just some minor comments and we are good to go

README.md Outdated Show resolved Hide resolved
ckanext/envvars/tests.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
test.ini Outdated Show resolved Hide resolved
nickumia-reisys and others added 5 commits July 12, 2022 09:44
Also, reference envvars, not dcat

Co-authored-by: Adrià Mercader <[email protected]>
Use ckantoolkit as toolkit instead of ckan.plugins.toolkit; based on @amercader suggestion
Replace dynamically in Github Actions instead of overwriting the standard install path based on @amercader's suggestion :)
Remove Python 2.6 support and require ckantoolkit install
@nickumia-reisys
Copy link
Contributor Author

Thanks for the thorough review @amercader! All of your suggestions were well explained and help to get it back to the CKAN standard. I hope I didn't miss anything 🎯

When this does get merged, don't forget to enabled Github Actions for the repo (if they're not already enabled) and the Data.gov team would greatly appreciate if there was a new PyPI release 😄

If it is of any interest to the CKAN team, there is an automated Github Action that publishes packages to PyPI (the only setup required is adding the PyPI token to the Github Secrets). Here's an example: https://github.com/GSA/ckanext-envvars/blob/main/.github/workflows/deploy.yml

@amercader amercader merged commit e44a4bf into ckan:master Jul 12, 2022
@amercader
Copy link
Member

@nickumia-reisys thanks, ckanext-envvars==0.0.2 is available on pypi 🚀

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