-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: standardize requirements and fixes for marshmallow3+ #98
Conversation
Signed-off-by: Dmitriy Kunitskiy <dkunitskiy@lyft.com>
Signed-off-by: Dmitriy Kunitskiy <dkunitskiy@lyft.com>
Signed-off-by: Dmitriy Kunitskiy <dkunitskiy@lyft.com>
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.
Generally LGTM.
Given that this package is guaranteed to only be used by other Amundsen projects, would it be reasonable to move the remaining dependencies to setup.py
and get rid of requirements.txt?
@@ -10,4 +10,4 @@ | |||
# review when someone opens a pull request. | |||
* @amundsen-io/amundsen-committers | |||
|
|||
*.py @feng-tao @jinhyukchang @allisonsuarez @dikshathakur3119 @verdan @bolkedebruin @mgorsk1 |
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 know Diksha left Lyft, but she's still an Amundsen committer. She's welcome to remove herself if she no longer wants to be associated with the project, and we'll eventually remove any inactive maintainers, but I think this isn't needed quite yet (and should be done in a separate PR anyhow)
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 don't believe she had intended to stay involved in the project, so the cleanup made sense. But I am happy to undo as well.
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 think remove the name doesn't mean remove her to be a committer. And I don't agree with the term we'll eventually remove any inactive maintainers
(not sure where it comes from). We made it explicit that only the committer could raise the request to not be a committer when we donated the project.
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.
@feng-tao ah, you're right, I remembered there being a default demotion to emeritus status due to inactivity in the governance, but that doesn't exist.
It's not an accepted practice to include unused-by-the-package dependencies in setup.py. Given that what's left in reqs.txt is test-only dependencies, requirements.txt is the right place I believe. |
@dkunitsk CI fails with unit test error |
def test(self) -> None: | ||
with app.test_request_context(), patch.object(http_header_caller_retrieval, 'request') as mock_request: | ||
with app.test_request_context(), \ |
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 am very confused why this was working previously. patch.object
returns an AsyncMock by default (see https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch) and that was not being used correctly.
@@ -12,4 +12,4 @@ | |||
class HttpHeaderCallerRetrieval(BaseCallerRetriever): | |||
def get_caller(self) -> str: | |||
header_key = flask_app.config.get(CALLER_HEADER_KEY, 'user-agent') | |||
return request.headers.get(header_key, 'UNKNOWN') | |||
return request.headers.get(header_key) or 'UNKNOWN' |
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.
Possibly a change due to the minor Flask upgrade: headers is a Headers object (not a dict) and the old mypy annotation was broken.
Signed-off-by: Dmitriy Kunitskiy <dkunitskiy@lyft.com>
@@ -25,6 +25,6 @@ jobs: | |||
with: | |||
python-version: ${{ matrix.python-version }} | |||
- name: Install dependencies | |||
run: pip3 install -r requirements.txt && pip3 install codecov | |||
run: pip3 install -r requirements.txt && pip3 install codecov && pip install . |
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.
using pip anyway as python setup.py install
leaves a build/
directory that makes mypy unhappy.
@feng-tao ready for another look and merge (assuming we agreed that cleaning up code owners made sense? i can revert that if not) |
Removal per amundsen-io/amundsencommon#98 (comment) Signed-off-by: Dorian Johnson <2020@dorianj.net>
Removal per amundsen-io/amundsencommon#98 (comment) Signed-off-by: Dorian Johnson <2020@dorianj.net>
Removal per amundsen-io/amundsencommon#98 (comment) Signed-off-by: Dorian Johnson <2020@dorianj.net>
Removal per amundsen-io/amundsencommon#98 (comment) Signed-off-by: Dorian Johnson <2020@dorianj.net>
Removal per amundsen-io/amundsencommon#98 (comment) Signed-off-by: Dorian Johnson <2020@dorianj.net>
Removal per amundsen-io/amundsencommon#98 (comment) Signed-off-by: Dorian Johnson <2020@dorianj.net>
Signed-off-by: Dmitriy Kunitskiy dkunitskiy@lyft.com
Summary of Changes
**kwargs
arg to decorated methods per marshmallow3 docs. This was blocking downstream adoption.install_requires
are installed by pip and requirements.txt are for the repo's own functionality. Generally requirements.txt should not repeat the packages in setup.py. Have changed to follow this convention.dependency_links
are NOT followed and the correct way to specify direct url dependencies is by putting them in install_requires using therepo @ git+url
syntax. Pip19 even removed the--follow-dependency-links
option.python setup.py install
does not use pip, it uses setuptools+easy_install which is old school. Turns out that setuptools only knows how to use dependency_links and does not know the syntax above. So I believe the answer is to include marshmallow-annotations in BOTH dependency_links AND install_requires. The former will be forpython3 install setup.py
and the latter for consumers who install this package via pip. The other option is to change this line to runpip install .
. But sincepython3 install setup.py
is so ubiquitously encouraged in Amundsen-land I wanted this to continue working.CheckList
Make sure you have checked all steps below to ensure a timely review.