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

feature/WEB-3928: add dependencies to setup.py, update Readme.md #13

Merged
merged 4 commits into from
Feb 3, 2020

Conversation

fredmajor
Copy link
Contributor

@fredmajor fredmajor commented Jan 31, 2020

Scope:

  • add project dependencies to setup.py, to enable complete installation with pip. Dependencies are re-conciliated against LTI and CookieCutter, to ensure no warnings during installation
  • dependencies use pip's concept of extras, as some are not mandatory for whole project
  • update instructions in Readme.md

Testing steps performed:

  • set up a vanilla django project, install OAuth2Client, make sure requested dependencies are installed and project works fine. Tested use of commands and ran the client. Done with python2.7 and python3.7. No problems noticed.

Jira: https://liv-it.atlassian.net/browse/WEB-3928?atlOrigin=eyJpIjoiNWFjYWE5ZjNmNGVkNDZjM2I1ZTY4MjQyNDk3ZWZlMWMiLCJwIjoiaiJ9

@fredmajor fredmajor self-assigned this Jan 31, 2020
@fredmajor fredmajor added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 31, 2020
README.md Outdated
-------------
#### Extras
As of version `0.2.0` this project provides two extras, `SF` and `providerApp`:
- `SF` - enables Salesforce JWT grant type support
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm doubt that SF is a good extras name as JWT grant type is a standard and can be used to connect to the other services in the future.
Please avoid using SF and Salesforce.
Could you also add a link to the RFC https://tools.ietf.org/html/rfc7519 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all good points, done

README.md Outdated
@@ -142,3 +160,12 @@ folder.
#### Coverage
If coverage is installed globally, it can take wrong version inside virtualenv,
so better uninstall it.

### Release History
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to be moved to a separate file or add it to the release description https://github.com/Livit/Labster.OAuth2Client/releases ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • based on merit: I see no difference between Readme.md vs a separate file. Of course unless we have an established convention of using "a separate file" approach.
  • personal opinion: I'd rather have 1 file to remember about doc-wise than >1 files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As for the release description in github: I'd rather write my docs first as I work with the code, and copy-paste to GH later when releasing.

Copy link
Contributor

Choose a reason for hiding this comment

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

According to https://www.makeareadme.com/

A README is a text file that introduces and explains a project. It contains information that is commonly required to understand what the project is about.

Release History is not that information.
It makes no much sense to load whole release history ( imagine how big it will be in 10+ releases) each time I open repo.

Cookie cutter project suggest having CHANGELOG.md

Copy link
Contributor Author

@fredmajor fredmajor Jan 31, 2020

Choose a reason for hiding this comment

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

Removing the history then. No one really asked for that. I can live without that. Note to myself: self, stick to the scope.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed. I've mentioned this to several open source projects - nothing worse than having to plough through reams of irrelevant change history before I can even find out what the project is supposed to do!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@labstersteve obviously I agree. That is why I intended to put it after the primary content of Readme :)

README.md Outdated
#### Extras
As of version `0.2.0` this project provides two extras, `SF` and `providerApp`:
- `SF` - enables Salesforce JWT grant type support
- `providerApp` - enables `oauth2_provider.Application` creation by means of
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename it to oauth2provider_command or provider_command instead?

README.md Show resolved Hide resolved
Copy link
Contributor

@labstersteve labstersteve left a comment

Choose a reason for hiding this comment

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

Couple of small comments, but otherwise good to go.

@@ -27,8 +28,25 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anything stopping Python 3.6 from working, or have we simply not tested it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't test it and officially supported versions are python 3.7 and python 2.7. Not my call, just updated a digit in a probably forgotten location.

install_requires=[
'django>=1.11.17,<=1.11.24;python_version=="2.7"',
'django>=2.2;python_version>="3.7"',
'psycopg2 >= 2.7.3',
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be using psycopg2-binary now?

Copy link
Contributor Author

@fredmajor fredmajor Feb 3, 2020

Choose a reason for hiding this comment

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

Good point. Right now I don't think so, but maybe you can correct me.

The psycopg2-binary vs psycopg2 split took place as of version 2.8. Currently LTI requires psycopg2==2.7.3.1. If we make the OAuth2Client require psycopg-binary, the installer will install the binary on top of LTI's own requirement (here I may be wrong). And we will end up with LTI using 2.8 de facto. (ugly and unclear situation to end up in) I just did a quick check with pip, and it seems that psycopg2 doesn't satisfy the requirement of psycopg2-binary, it got reinstalled on-top. But maybe there is some extra-magic layer for resolving such conflicts and we already use it, I don't know.

Apart from that, if we coordinate the change across multiple projects, I don't see any problems.

Quick test I performed (clean venv):

╭─[~/PyCharmProjects/venvs]─[fred@pop-os]─[0]─[10056]
╰─[:)] % pip install psycopg2                     
Processing /home/fred/.cache/pip/wheels/e5/95/7b/9065a4dfe97a9b0e458215ea04fa87c169e20c9bddf49f766a/psycopg2-2.8.4-cp37-cp37m-linux_x86_64.whl
Installing collected packages: psycopg2
Successfully installed psycopg2-2.8.4
╭─[~/PyCharmProjects/venvs]─[fred@pop-os]─[0]─[10057]
╰─[:)] % pip install psycopg2-binary
Collecting psycopg2-binary
  Downloading psycopg2_binary-2.8.4-cp37-cp37m-manylinux1_x86_64.whl (2.9 MB)
     |████████████████████████████████| 2.9 MB 743 kB/s 
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.4

Some reference materials I found useful:

@fredmajor fredmajor merged commit 174a1de into master Feb 3, 2020
@fredmajor fredmajor deleted the feature/WEB-3928_dependencies branch February 3, 2020 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants