[x] Add the GitHub Action Workflow to support py39-py312.
[x] Add the pre-commit job
[x] Add the test {py39-py312} on {linux, osx, win} job (without running pytest now, see the Notes below)
[x] Add dev tools:
[x] Add pre-commit-config.yaml with linters and formatters
[x] Add Makefile to make development easier
[x] Add environment.yaml for the main environment
[x] Add environment-dev.yaml for the development environment
[x] Fix the build_url function by moving if resource_id: to the top of the function. It was investigated that:
MAILJET_API_URL/contact/123456/managemanycontacts seems to be the correct order. It should also be like this https://api.mailjet.com/v3/REST/contact/CONTACT_ID/managecontactslists.
So the #86 could be wrong (see https://github.com/mailjet/mailjet-apiv3-python/pull/86#issue-1590835080). If you replace the resource_id and action_id (e.g., MAILJET_API_URL/contact/managemanycontacts/123456), the endpoint will be unavailable and, accordingly, the test will also fail with status code 400.
The API docs also have the correct order https://dev.mailjet.com/email/reference/contacts/subscriptions/#v3_post_contact_contact_ID_managecontactslists. Therefore, it is surprising what kind of a bug the user had 1 year ago. I think the user used the wrong mailjet.contact_managemanycontacts.get(jobID) method, although it should have been mailjet.contact_managemanycontacts.create(jobID), because the POST method always goes with create()
- [x] It fixes `test.py::TestSuite::test_get_with_action` on my local machine.
- [x] Packaging:
- [x] Replace `setup.py` with `pyprpoject.toml`
- [x] Remove `requirements.txt` as obsolete
- [x] Minor fixes:
- [x] Fix spelling in `CHANGELOG.md`, `README.md`
- [x] Add an empty line at the end of the `LICENSE` file
## Notes:
- To enable running tests with `pytest` in GitHub Actions, we need an **Environment** section in the repository **Settings**, but it doesn't exist because of a legacy plan (possibly), see https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment
Actions:
[x] Add the GitHub Action Workflow to support py39-py312.
pre-commit
jobtest {py39-py312} on {linux, osx, win}
job (without runningpytest
now, see the Notes below)[x] Add dev tools:
pre-commit-config.yaml
with linters and formattersMakefile
to make development easierenvironment.yaml
for the main environmentenvironment-dev.yaml
for the development environment[x] Fix the
build_url
function by movingif resource_id:
to the top of the function. It was investigated that:MAILJET_API_URL/contact/123456/managemanycontacts
seems to be the correct order. It should also be like thishttps://api.mailjet.com/v3/REST/contact/CONTACT_ID/managecontactslists
. So the #86 could be wrong (see https://github.com/mailjet/mailjet-apiv3-python/pull/86#issue-1590835080). If you replace theresource_id
andaction_id
(e.g.,MAILJET_API_URL/contact/managemanycontacts/123456
), the endpoint will be unavailable and, accordingly, the test will also fail with status code 400. The API docs also have the correct order https://dev.mailjet.com/email/reference/contacts/subscriptions/#v3_post_contact_contact_ID_managecontactslists. Therefore, it is surprising what kind of a bug the user had 1 year ago. I think the user used the wrong mailjet.contact_managemanycontacts.get(jobID) method, although it should have been mailjet.contact_managemanycontacts.create(jobID), because the POST method always goes withcreate()
[x] I've tested it with curl:
{ "Count" : 1, "Data" : [{ "ContactsLists" : [{ "Action" : "addforce", "ListID" : XXXXXX }] }], "Total" : 1 }