Python 3 support has finally arrived. If your project is Python 3 only, or if it supports Python 2 and also 3, then you can now have Landscape check using Python 3. Here's how.

If you are currently writing a project which is Python 3 compatible, then you are probably getting warnings from Landscape about 'syntax errors'. This is because until now Landscape was always checking using Python 2 and therefore 3-only syntax such as yield from was marked as an error.

Now Landscape can run expecting either Python 2 or 3. The default behaviour remains to check using and expecting Python 2, but you can trigger the new version in one of two ways.

Firstly, if your project has a file in the root of the repository, containing appropriate trove classifiers indicating that (any) Python 3 version is supported, then Landscape has already started checking your projects with Python 3.

If you don't have that, or if it is not being correctly detected, you can manually specify which major python versions your project supports using a new directive called python-targets in your Landscape configuration file.

For supporting both:

python-targets: [2, 3]

For Python 3-only projects:

python-targets: 3

You can read more in the Landscape configuration documentation.

I hope you enjoy using this new, extremely-long-in-coming feature!

Other Recent Bug Fixes

  • If a file is larger than 1MB, then it cannot be fetched via the GitHub API. Previously this would simply break the Landscape UI. Now, this is noted and you can at least still see the messages and line numbers, just not alongside the contents.
  • Pylint 1.5 was released and is now being used by the checks. This may result in additional or different errors to previously.
  • #202 Pull Requests made from other repositories didn't get status updates: this is now fixed.
  • #201 Timestamps for commits etc will now be shown using a user's timezone. This is detected by IP geo-lookup, but can also be set manually in the preferences page.
  • #86 Repositories can now be hidden from the dashboard. Additionally, the dashboard can now be filtered to only show repositories for a particular organisation.
  • #152 Some additional system packages were added to builds to enable building and installing of libraries such as lxml or cryptography
  • #16 and #137 There is now a 'refresh' icon on check pages to force an immediate recheck of the latest commit of whichever branch is being displayed.
  • #135 branches called gh-pages are not shown in the list of checks when no python files are found, to avoid showing "no python files were found" errors for documentation branches.
  • Fixed menu links on homepage for mobile users. Previously, at small widths, the second layer of links from the menu bar was black text on black background.

If you enjoyed this article and would like to receive email notifications when new articles are published, sign up below:

About is a tool to measure and track code quality and technical debt in your project. It can analyse Python code to point out errors and problems, and provides continuous metrics so you can see if your code is deteriorating.