8000 0.8 cleanups (0.8.11 release candidate) by GriceTurrble · Pull Request #225 · python-amazon-mws/python-amazon-mws · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Conversation

@GriceTurrble
Copy link
Member
@GriceTurrble GriceTurrble commented Oct 9, 2020

Major Changes

  • Version bumped to 0.8.11
  • Small update for Python 3.9 compatibility
    • Removed deprecated call to ElementTree.getchildren, removed in 3.9.
    • Code changed to match develop version: node is iterated directly.
  • Consolidated tooling compared to develop version
    • Added GitHub Actions test workflow, covering Python 3.5 (as legacy) to Python 3.9 (current)
      • Test suite in the project is minimal compared to develop, but is enough to point out some glaring problems.
    • .converagerc and pytest.ini removed, settings added to setup.cfg
      • Will bring this change to develop as well.
    • Other setup.cfg configs coped from develop.
    • Dropped TravisCI config (moving away from Travis in favor of Github Actions workflows)
    • Removed root Makefile (will rely on native Python tooling, rather than make aliases)
    • Added pre-commit
  • Utilities backported from 1.0dev as future_utils
    • All objects available in 1.0dev under mws.utils can be found here as mws.future_utils (avoids name conflict with existing utils.py)
    • XML utilities that rely on xmltodict dependency (not added to master branch version) will raise NotImplementedError instead.
  • Parameter cleaning updated to match develop version
  • Old duplicate utilities removed
    • remove_empty, replaced by future util remove_empty_params
    • remove_namespace, replaced by future util remove_xml_namespaces
    • MWS.get_timestamp, deprecated, replaced by future util mws_utc_now
      • Deprecated get_timestamp would return a formatted string. This updated version uses mws_utc_now (which returns a datetime.datetime object) and then explicitly returns .isoformat() output, so the output is the same as before
      • Code that used get_timestamp now uses mws_utc_now, which returns datetime.datetime instances. Other backported utilities perform proper parameter cleaning (similar to develop) to convert to str output as needed.
  • ObjectDict backported from 1.0dev
    • "Old" version of the class did not have parity with the "new" one (though the new one is marked for deprecation). Native iteration was not possible as expected in the newer API.
    • This brings parity between the master and develop versions of that particular class.

Minor changes

  • requirements-dev.txt added, copied from develop version
  • requirements.txt updated to match that from develop version
  • setup.py now correctly uses setuptools.find_packages(), similar to develop version.
  • Package version corrected throughout project (found some spots where it was still 0.7!)
    • User agent string should correctly import the project version to automatically update itself for later releases.
  • LICENSE file changed to plain file, no .txt extension (MANIFEST updated to match)
  • All files run through black per pre-commit full run
  • Some files touched by pre-commit full run for line endings and trailing whitespace.
  • gitignore updated to match develop version (soon to include line related to Codespaces, also included here)
  • Docs requirements updated, but docs untouched in this version (outside of pre-commit touches)
  • AUTHORS updated (take credit for your work!)

Not going to bother with format check or linter, though.
(spellchecker addon bugged me)
Will be the version after this change merges.
Unable to backport some methods in xml module,
so instead have those functions raise error.
Don't need them anymore
Disabled in section to shut it up without destroying my local dictionary
Removing empty kwargs and cleaning inputs (corrects #214)
Using mws_utc_now in place of deprecated get_timestamp method
Deprecation warning now raised in get_timestamp,
which now uses datetime.isoformat instead of gmtime and strtime.
Some spelling errors corrected.
Have to import MWSError at runtime in appropriate functions,
instead of top-level, due to circular imports.
Running against pre-3.6, not supported.
Shouldn't bother anyway, removed
getchildren deprecated in Py3.2, and finally removed in Py3.9, making it now a breaking change.
Removed and replaced with the recommended iter(node)
just iterates the node natively
Changing to match.
@GriceTurrble GriceTurrble added bug enhancement housekeeping Tasks that help the maintenance of the project, including releases, testing, and configurations. labels Oct 9, 2020
@GriceTurrble GriceTurrble self-assigned this Oct 9, 2020
@GriceTurrble GriceTurrble added this to the 0.8.11 milestone Oct 9, 2020
Copied from develop
Both required checks for merges, and not willing to mess around with repo settings to exclude them.
Not being tested directly,
and it would be worthwhile to know if it breaks there for some odd reason
(unlikely, but never hurts)
While ObjectDict is deprecated on later versions of the project,
the old and "new" versions of this object
did not have parity, leading to issues
such as #226 .
Copied ObjectDict over from `develop` version to correct this.
Copy link
Member
@Bobspadger Bobspadger left a comment

Choose a reason for hiding this comment

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

Removing the makefile - ok, but now hides the build commands for pushing to pypi.

@@ -0,0 +1,39 @@
from .collections import unique_list_order_preserved
Copy link
Member

Choose a reason for hiding this comment

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

could there end up with a namespace conflict here, collections is a python standard library?

I've had weird stuff like this happen before, it shouldn't happen, but sometimes does!

Copy link
Member Author

Choose a reason for hiding this comment

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

That is possible, though I think it's less an issue in Python 3 with the absolute imports.

If we're still trying to support Py2 for compatibility in 0.8, then yes that could be a minor issue. Might have to pepper in from __future__ import absolute_import to be safe there.

Copy link
Member

Choose a reason for hiding this comment

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

That is possible, though I think it's less an issue in Python 3 with the absolute imports.

If we're still trying to support Py2 for compatibility in 0.8, then yes that could be a minor issue. Might have to pepper in from __future__ import absolute_import to be safe there.

hmmmmm we've pretty much ditched py2 haven't we so don't put more work in than is necessary.

Copy link
Member
@Bobspadger Bobspadger left a comment

Choose a reason for hiding this comment

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

Only comment really is on the .collections namespace.

@GriceTurrble
Copy link
Member Author

Re: the Makefile removal, I assume that the command python setup.py sdist bdist_wheel was used to build and send it over to PyPI?

That's one area where we could have an Actions workflow take over, to trigger on tags been added with new version numbers.

@Bobspadger
Copy link
Member

Re: the Makefile removal, I assume that the command python setup.py sdist bdist_wheel was used to build and send it over to PyPI?

That's one area where we could have an Actions workflow take over, to trigger on tags been added with new version numbers.

python setup.py sdist bdist_wheel builds it

python3 -m twine upload dist/* is what uploads to pypi and requires credentials etc.

@GriceTurrble GriceTurrble merged commit 89fc486 into master Nov 18, 2020
@GriceTurrble GriceTurrble deleted the task-master-branch-cleanups branch January 26, 2021 17:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug enhancement housekeeping Tasks that help the maintenance of the project, including releases, testing, and configurations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InboundShipments:create_inbound_shipment_plan issue (TypeError: quote_from_bytes() expected bytes)

3 participants

0