forked from platformio/platformio-core
Refactore code without "arrow" dependency (resolve issue with "ImportError: No module named backports.functools_lru_cache")
This commit is contained in:
@ -1,3 +1,3 @@
|
|||||||
[settings]
|
[settings]
|
||||||
line_length=79
|
line_length=79
|
||||||
known_third_party=arrow,bottle,click,lockfile,pytest,requests,SCons,semantic_version,serial
|
known_third_party=bottle,click,lockfile,python-dateutil,pytest,requests,SCons,semantic_version,serial
|
||||||
|
@ -14,6 +14,7 @@ PlatformIO 3.0
|
|||||||
* Configure a custom firmware/program name in build directory (`example <http://docs.platformio.org/page/projectconf/advanced_scripting.html#custom-firmware-program-name>`__)
|
* Configure a custom firmware/program name in build directory (`example <http://docs.platformio.org/page/projectconf/advanced_scripting.html#custom-firmware-program-name>`__)
|
||||||
* Renamed ``envs_dir`` option to ``build_dir``
|
* Renamed ``envs_dir`` option to ``build_dir``
|
||||||
in `Project Configuration File "platformio.ini" <http://docs.platformio.org/page/projectconf/section_platformio.html#build-dir>`__
|
in `Project Configuration File "platformio.ini" <http://docs.platformio.org/page/projectconf/section_platformio.html#build-dir>`__
|
||||||
|
* Refactored code without "arrow" dependency (resolve issue with "ImportError: No module named backports.functools_lru_cache")
|
||||||
* Improved support of PIO Unified Debugger for Eclipse Oxygen
|
* Improved support of PIO Unified Debugger for Eclipse Oxygen
|
||||||
* Improved a work in off-line mode
|
* Improved a work in off-line mode
|
||||||
* Fixed project generator for CLion IDE
|
* Fixed project generator for CLion IDE
|
||||||
|
2
docs
2
docs
Submodule docs updated: 1d05a91d45...8ad4e900ea
@ -291,9 +291,8 @@ class LibBuilderBase(object):
|
|||||||
|
|
||||||
def get_search_files(self):
|
def get_search_files(self):
|
||||||
items = [
|
items = [
|
||||||
join(self.src_dir, item)
|
join(self.src_dir, item) for item in self.env.MatchSourceFiles(
|
||||||
for item in self.env.MatchSourceFiles(self.src_dir,
|
self.src_dir, self.src_filter)
|
||||||
self.src_filter)
|
|
||||||
]
|
]
|
||||||
include_dir = self.include_dir
|
include_dir = self.include_dir
|
||||||
if include_dir:
|
if include_dir:
|
||||||
@ -644,9 +643,9 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
|||||||
# test files
|
# test files
|
||||||
if "__test" in COMMAND_LINE_TARGETS:
|
if "__test" in COMMAND_LINE_TARGETS:
|
||||||
items.extend([
|
items.extend([
|
||||||
join("$PROJECTTEST_DIR", item)
|
join("$PROJECTTEST_DIR",
|
||||||
for item in self.env.MatchSourceFiles("$PROJECTTEST_DIR",
|
item) for item in self.env.MatchSourceFiles(
|
||||||
"$PIOTEST_SRC_FILTER")
|
"$PROJECTTEST_DIR", "$PIOTEST_SRC_FILTER")
|
||||||
])
|
])
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ from os.path import isdir, join
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
from urllib import quote
|
from urllib import quote
|
||||||
|
|
||||||
import arrow
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio import exception, util
|
from platformio import exception, util
|
||||||
@ -323,9 +322,7 @@ def lib_show(library, json_output):
|
|||||||
click.echo(lib['description'])
|
click.echo(lib['description'])
|
||||||
click.echo()
|
click.echo()
|
||||||
|
|
||||||
click.echo("Version: %s, released %s" %
|
click.echo("Version: {name}, released {released}".format(**lib['version']))
|
||||||
(lib['version']['name'],
|
|
||||||
arrow.get(lib['version']['released']).humanize()))
|
|
||||||
click.echo("Manifest: %s" % lib['confurl'])
|
click.echo("Manifest: %s" % lib['confurl'])
|
||||||
for key in ("homepage", "repository", "license"):
|
for key in ("homepage", "repository", "license"):
|
||||||
if key not in lib or not lib[key]:
|
if key not in lib or not lib[key]:
|
||||||
@ -360,11 +357,10 @@ def lib_show(library, json_output):
|
|||||||
blocks.append(("Compatible %s" % key, [i['title'] for i in lib[key]]))
|
blocks.append(("Compatible %s" % key, [i['title'] for i in lib[key]]))
|
||||||
blocks.append(("Headers", lib['headers']))
|
blocks.append(("Headers", lib['headers']))
|
||||||
blocks.append(("Examples", lib['examples']))
|
blocks.append(("Examples", lib['examples']))
|
||||||
blocks.append(("Versions", [
|
blocks.append(
|
||||||
"%s, released %s" % (v['name'], arrow.get(v['released']).humanize())
|
("Versions",
|
||||||
for v in lib['versions']
|
["{name}, released {released}".format(**v) for v in lib['versions']]))
|
||||||
]))
|
blocks.append(("Downloads", [
|
||||||
blocks.append(("Unique Downloads", [
|
|
||||||
"Today: %s" % lib['dlstats']['day'],
|
"Today: %s" % lib['dlstats']['day'],
|
||||||
"Week: %s" % lib['dlstats']['week'],
|
"Week: %s" % lib['dlstats']['week'],
|
||||||
"Month: %s" % lib['dlstats']['month']
|
"Month: %s" % lib['dlstats']['month']
|
||||||
@ -423,9 +419,7 @@ def lib_stats(json_output):
|
|||||||
click.echo((printitemdate_tpl
|
click.echo((printitemdate_tpl
|
||||||
if "date" in item else printitem_tpl).format(
|
if "date" in item else printitem_tpl).format(
|
||||||
name=click.style(item['name'], fg="cyan"),
|
name=click.style(item['name'], fg="cyan"),
|
||||||
date=str(
|
date=item.get("date"),
|
||||||
arrow.get(item['date']).humanize()
|
|
||||||
if "date" in item else ""),
|
|
||||||
url=click.style(
|
url=click.style(
|
||||||
"http://platformio.org/lib/show/%s/%s" %
|
"http://platformio.org/lib/show/%s/%s" %
|
||||||
(item['id'], quote(item['name'])),
|
(item['id'], quote(item['name'])),
|
||||||
|
@ -20,8 +20,8 @@ import re
|
|||||||
from glob import glob
|
from glob import glob
|
||||||
from os.path import isdir, join
|
from os.path import isdir, join
|
||||||
|
|
||||||
import arrow
|
|
||||||
import click
|
import click
|
||||||
|
from dateutil.parser import parse as parse_date
|
||||||
|
|
||||||
from platformio import app, commands, exception, util
|
from platformio import app, commands, exception, util
|
||||||
from platformio.managers.package import BasePkgManager
|
from platformio.managers.package import BasePkgManager
|
||||||
@ -157,8 +157,8 @@ class LibraryManager(BasePkgManager):
|
|||||||
def max_satisfying_repo_version(self, versions, requirements=None):
|
def max_satisfying_repo_version(self, versions, requirements=None):
|
||||||
|
|
||||||
def _cmp_dates(datestr1, datestr2):
|
def _cmp_dates(datestr1, datestr2):
|
||||||
date1 = arrow.get(datestr1)
|
date1 = parse_date(datestr1)
|
||||||
date2 = arrow.get(datestr2)
|
date2 = parse_date(datestr2)
|
||||||
if date1 == date2:
|
if date1 == date2:
|
||||||
return 0
|
return 0
|
||||||
return -1 if date1 < date2 else 1
|
return -1 if date1 < date2 else 1
|
||||||
|
2
setup.py
2
setup.py
@ -18,11 +18,11 @@ from platformio import (__author__, __description__, __email__, __license__,
|
|||||||
__title__, __url__, __version__)
|
__title__, __url__, __version__)
|
||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
"arrow>=0.10.0,!=0.11.0",
|
|
||||||
"bottle<0.13",
|
"bottle<0.13",
|
||||||
"click>=5,<6",
|
"click>=5,<6",
|
||||||
"colorama",
|
"colorama",
|
||||||
"lockfile>=0.9.1,<0.13",
|
"lockfile>=0.9.1,<0.13",
|
||||||
|
"python-dateutil",
|
||||||
"pyserial>=3,<4,!=3.3",
|
"pyserial>=3,<4,!=3.3",
|
||||||
"requests>=2.4.0,<3",
|
"requests>=2.4.0,<3",
|
||||||
"semantic_version>=2.5.0,<3"
|
"semantic_version>=2.5.0,<3"
|
||||||
|
@ -141,8 +141,7 @@ def test_global_lib_list(clirunner, validate_cliresult):
|
|||||||
result = clirunner.invoke(cmd_lib, ["-g", "list"])
|
result = clirunner.invoke(cmd_lib, ["-g", "list"])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
assert all([
|
assert all([
|
||||||
n in result.output
|
n in result.output for n in
|
||||||
for n in
|
|
||||||
("Source: https://github.com/adafruit/Adafruit-ST7735-Library/archive/master.zip",
|
("Source: https://github.com/adafruit/Adafruit-ST7735-Library/archive/master.zip",
|
||||||
"Version: 5.10.1",
|
"Version: 5.10.1",
|
||||||
"Source: git+https://github.com/gioblu/PJON.git#3.0",
|
"Source: git+https://github.com/gioblu/PJON.git#3.0",
|
||||||
@ -151,8 +150,7 @@ def test_global_lib_list(clirunner, validate_cliresult):
|
|||||||
|
|
||||||
result = clirunner.invoke(cmd_lib, ["-g", "list", "--json-output"])
|
result = clirunner.invoke(cmd_lib, ["-g", "list", "--json-output"])
|
||||||
assert all([
|
assert all([
|
||||||
n in result.output
|
n in result.output for n in
|
||||||
for n in
|
|
||||||
("__pkg_dir",
|
("__pkg_dir",
|
||||||
'"__src_url": "git+https://gitlab.com/ivankravets/rs485-nodeproto.git"',
|
'"__src_url": "git+https://gitlab.com/ivankravets/rs485-nodeproto.git"',
|
||||||
'"version": "5.10.1"')
|
'"version": "5.10.1"')
|
||||||
@ -172,10 +170,10 @@ def test_global_lib_list(clirunner, validate_cliresult):
|
|||||||
for item in json.loads(result.output)
|
for item in json.loads(result.output)
|
||||||
]
|
]
|
||||||
versions2 = [
|
versions2 = [
|
||||||
'ArduinoJson@5c33fd4', 'ArduinoJson@5.8.2', 'ArduinoJson@5.10.1',
|
'ArduinoJson@5.8.2', 'ArduinoJson@5.10.1', 'AsyncMqttClient@0.8.2',
|
||||||
'AsyncMqttClient@0.8.2', 'AsyncTCP@1.0.1', 'ESPAsyncTCP@1.1.3',
|
'AsyncTCP@1.0.1', 'ESPAsyncTCP@1.1.3', 'NeoPixelBus@2.2.4',
|
||||||
'NeoPixelBus@2.2.4', 'PJON@07fe9aa', 'PJON@1fb26fd',
|
'PJON@07fe9aa', 'PJON@1fb26fd', 'PubSubClient@bef5814',
|
||||||
'PubSubClient@bef5814', 'RFcontrol@77d4eb3f8a', 'RadioHead-1.62@0.0.0'
|
'RFcontrol@77d4eb3f8a', 'RadioHead-1.62@0.0.0'
|
||||||
]
|
]
|
||||||
assert set(versions1) >= set(versions2)
|
assert set(versions1) >= set(versions2)
|
||||||
|
|
||||||
@ -272,7 +270,7 @@ def test_lib_stats(clirunner, validate_cliresult):
|
|||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
assert all([
|
assert all([
|
||||||
s in result.output
|
s in result.output
|
||||||
for s in ("UPDATED", "ago", "http://platformio.org/lib/show")
|
for s in ("UPDATED", "POPULAR", "http://platformio.org/lib/show")
|
||||||
])
|
])
|
||||||
|
|
||||||
result = clirunner.invoke(cmd_lib, ["stats", "--json-output"])
|
result = clirunner.invoke(cmd_lib, ["stats", "--json-output"])
|
||||||
|
Reference in New Issue
Block a user