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

Remove python2.7 from supported versions of Python #305

Merged
merged 9 commits into from
Jan 7, 2021

Conversation

MaxG87
Copy link
Contributor

@MaxG87 MaxG87 commented Aug 30, 2019

Version 2.7 of Python soon will reach the end of its live. It already
hinders the application of new language features which are incompatible
with 2.7. Thus, stopping to support python2.7. is necessary.

All major distributions ship some version of the Python3 series already.
Thus, stopping to support python2.7 should be relatively light in
trouble for users.

@jmaupetit
Copy link
Member

That's a breaking change that should stand in Watson 2.0.0 roadmap!

I have no idea how many Watson's users are still using python 2...

@MaxG87
Copy link
Contributor Author

MaxG87 commented Aug 30, 2019

I have to admit that I created this PR mainly because I was so annoyed of having to import stuff in a way Python2.7 can digest. Anyhow, Python3.5 is available even in Debian Stretch, Pyhon3.6 in RedHat 7.

@k4nar
Copy link
Collaborator

k4nar commented Aug 30, 2019

https://pythonclock.org 😄

This would be a great thing, but as @jmaupetit mentioned it should probably be released in a 2.0.

tests/test_watson.py Outdated Show resolved Hide resolved
k4nar
k4nar previously approved these changes Aug 30, 2019
Copy link
Collaborator

@k4nar k4nar left a comment

Choose a reason for hiding this comment

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

👍

@KennethNielsen
Copy link
Contributor

I just wanted to add, that whether by accident or purpose, that last time I ran the test suite, there were also python 2 problems.

Copy link
Contributor

@davidag davidag left a comment

Choose a reason for hiding this comment

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

Some other things that apply to Watson:

  • Encoding declarations at the beginning of files can be removed.
  • All ImportError try/except blocks can be removed.
  • Add python_requires in setup.py.
  • The u prefix in string literals can be removed as there are only Unicode literals in Python3.

@MaxG87
Copy link
Contributor Author

MaxG87 commented Oct 24, 2019 via email

@MaxG87
Copy link
Contributor Author

MaxG87 commented Jun 19, 2020

Now with 1.9.0 out (thank you very much), maybe its time to apply this patch? I suspect plenty of other benefits to be reachable once we get this, e.g. typing.NamedTuple or dataclasses.

Maybe one could directly move to 3.6?

@MaxG87 MaxG87 force-pushed the py3only branch 2 times, most recently from 7df9ba7 to f7fb625 Compare June 19, 2020 13:04
k4nar
k4nar previously approved these changes Jun 22, 2020
@MaxG87
Copy link
Contributor Author

MaxG87 commented Sep 24, 2020

Are there any updates here? I would like to contribute a bit more but I am annoyed by having to pay attention to Python 2.7 (and, to lesser extend, to Python 3.5). Even Python 3.5 has reached EOL.

k4nar
k4nar previously approved these changes Jan 6, 2021
Copy link
Member

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

I'll merge this once rebased (and fixed). It's a major step. Thanks! 🙏

watson/cli.py Outdated Show resolved Hide resolved
watson/version.py Outdated Show resolved Hide resolved
Version 2.7 of Python soon will reach the end of its live. It already
hinders the application of new language features which are incompatible
with 2.7. Thus, stopping to support `python2.7.` is necessary.

All major distributions ship some version of the Python3 series already.
Thus, stopping to support `python2.7` should be relatively light in
trouble for users.
The string 'builtins' can be used directly now that support for
Python2.7 is not mandatory anymore.
@jmaupetit
Copy link
Member

Thanks @MaxG87 🙏 I forgot to ask you one last thing: can you add this major change in the CHANGELOG please?

@jmaupetit jmaupetit merged commit 510fc1a into TailorDev:master Jan 7, 2021
Watson 2.0 automation moved this from High priority to Closed Jan 7, 2021
jmaupetit added a commit that referenced this pull request Mar 19, 2021
Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (#395)
- Python 3.8 support (#402)
- Python 3.9 support (#402)
- Support for the TZ environment variable to specify the local time zone
  (#391)

Changed:

- Upgrade to major arrow release 1.0.0 (#407)

Fixed:

- Zsh completion (#379)

Removed:

- Python 2.7 support (#305).
- Python 3.5 support (#407).
@jmaupetit jmaupetit mentioned this pull request Mar 19, 2021
jmaupetit added a commit that referenced this pull request Mar 19, 2021
Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (#395)
- Python 3.8 support (#402)
- Python 3.9 support (#402)
- Support for the TZ environment variable to specify the local time zone
  (#391)

Changed:

- Upgrade to major arrow release 1.0.0 (#407)

Fixed:

- Zsh completion (#379)

Removed:

- Python 2.7 support (#305).
- Python 3.5 support (#407).
veganjay pushed a commit to veganjay/Watson that referenced this pull request May 15, 2021
Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (TailorDev#395)
- Python 3.8 support (TailorDev#402)
- Python 3.9 support (TailorDev#402)
- Support for the TZ environment variable to specify the local time zone
  (TailorDev#391)

Changed:

- Upgrade to major arrow release 1.0.0 (TailorDev#407)

Fixed:

- Zsh completion (TailorDev#379)

Removed:

- Python 2.7 support (TailorDev#305).
- Python 3.5 support (TailorDev#407).
@MaxG87 MaxG87 deleted the py3only branch June 2, 2021 09:07
samtx added a commit to samtx/Watson that referenced this pull request Apr 17, 2022
* Resolve Issue TailorDev#407: Migrate to arrow 1.0.0

- requirements.txt: specify arrow==1.00
- frames.py, fullmoon.py, watson.py: change "timestamp" to
  "int_timestamp"

* Resolve Issue TailorDev#407: Migrate to arrow 1.0.0

- cli.py: change "date.tzinfo = tz.tzlocal()" to "date.replace(tzinfo=tz.tzlocal())"

* Update requirements.txt

This makes sense, especially given that arrow is already up to 1.0.2

Co-authored-by: Julien Maupetit <jmaupetit@users.noreply.github.com>

* Resolve Issue TailorDev#407: Migrate to arrow 1.0.0

- watson.cli.py: use date = date.replace(tzinfo=tz.tzlocal())
  (date.replace does not modify the existing object)

* Resolve Issue TailorDev#407: Migrate to arrow 1.0.0

Update unit test cases:

- tests/test_cli.py: replace arrow.arrow.datetime with arrow.arrow.dt_datetime
- tests/test_watson.py: replace .timestamp with .int_timestamp

* Resolve Issue TailorDev#407: Migrate to arrow 1.0.0

- .travis.yml: remove python 3.5
- setup.py: require python >= 3.6
- CHANGELOG.md: mention arrow upgrade and drop of python 3.5 support

* Update watson.zsh-completion

fix: autocompletion won't work with zsh 5.8

* Use TZ environment variable to set the timezone (TailorDev#411)

Watson did not have a way to set the timezone, other than what the system used.
In UNIX you can set the TZ variable to represent the timezone you want your
programs to respect.

* Bump release to 2.0.0

Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (TailorDev#395)
- Python 3.8 support (TailorDev#402)
- Python 3.9 support (TailorDev#402)
- Support for the TZ environment variable to specify the local time zone
  (TailorDev#391)

Changed:

- Upgrade to major arrow release 1.0.0 (TailorDev#407)

Fixed:

- Zsh completion (TailorDev#379)

Removed:

- Python 2.7 support (TailorDev#305).
- Python 3.5 support (TailorDev#407).

* Fix year in 2.0.0 release

Believe it or not its 2021!

* Gracefully handle empty stop time (TailorDev#418)

Recent arrow library update broke the current frame edition.

* Bump release to 2.0.1

Fixed:

- Ability to `edit` the current frame (TailorDev#418)

* Add 'notes' field to frames.

This is a large commit that adds the following:

1. Syntax: `watson stop --notes "some additional information"`.
2. Print only non-empty notes in log.
3. Always pass id to `new_frame` so that the length of array with/without
   notes doesn't cause ambiguity.
4. Print a warning message and the existing note if overwriting a note.
5. Print notes in report.

Primary work here was done by the following people:

Co-authored-by: Tristan Pratt <prat0088@gmail.com>
Co-authored-by: Joel Ostblom <joelostblom@users.noreply.github.com>

* notes: Print notes in `watson log`.

* notes: Fix tests.

* Set requirements for click >= 8.0 and rename autocompletion parameter to shell_complete. Remove 'multiple' paramater on reporting option

Co-authored-by: Jason Youzwak <jyouzwak@perspectalabs.com>
Co-authored-by: veganjay <veganjay@gmail.com>
Co-authored-by: Julien Maupetit <jmaupetit@users.noreply.github.com>
Co-authored-by: Nikolay Shkrylev <snnwolf@users.noreply.github.com>
Co-authored-by: Eddie Ash <cazador481@users.noreply.github.com>
Co-authored-by: Julien Maupetit <julien@maupetit.net>
Co-authored-by: Matthew Barry <komputerwiz.matt@gmail.com>
Co-authored-by: Rohitt Vashishtha <aero31aero@gmail.com>
Co-authored-by: Tristan Pratt <prat0088@gmail.com>
Co-authored-by: Joel Ostblom <joelostblom@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Watson 2.0
  
Closed
Development

Successfully merging this pull request may close these issues.

None yet

5 participants