D2751: cbor: remove unrequired files and fix core test-check*

2018-03-26 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0e06d8086295: cbor: fix core test-check* (authored by 
pulkit, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D2751?vs=6757=7292#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2751?vs=6757=7292

REVISION DETAIL
  https://phab.mercurial-scm.org/D2751

AFFECTED FILES
  tests/test-check-py3-compat.t
  tests/test-check-pyflakes.t

CHANGE DETAILS

diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
--- a/tests/test-check-pyflakes.t
+++ b/tests/test-check-pyflakes.t
@@ -16,6 +16,7 @@
   $ testrepohg locate 'set:**.py or grep("^#!.*python")' \
   > -X hgext/fsmonitor/pywatchman \
   > -X mercurial/pycompat.py -X contrib/python-zstandard \
+  > -X mercurial/thirdparty/cbor \
   > 2>/dev/null \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
   
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -5,6 +5,7 @@
 
   $ testrepohg files 'set:(**.py)' \
   > -X hgdemandimport/demandimportpy2.py \
+  > -X mercurial/thirdparty/cbor \
   > | sed 's|\\|/|g' | xargs $PYTHON contrib/check-py3-compat.py
   contrib/python-zstandard/setup.py not using absolute_import
   contrib/python-zstandard/setup_zstd.py not using absolute_import



To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2751: cbor: remove unrequired files and fix core test-check*

2018-03-26 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  I'm going to fold the deletes into the previous commit and rewrite the commit 
message of this one accordingly.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2751

To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2751: cbor: remove unrequired files and fix core test-check*

2018-03-09 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This patch removes the unrequired files from the cbor library which are docs/,
  tests/, setup.py, setup.cfg, tox.ini.
  
  Also, this patch fixes couple of test-check* tests by making sure they skip
  testing the third party library cbor.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2751

AFFECTED FILES
  mercurial/thirdparty/cbor/docs/conf.py
  mercurial/thirdparty/cbor/docs/customizing.rst
  mercurial/thirdparty/cbor/docs/index.rst
  mercurial/thirdparty/cbor/docs/modules/decoder.rst
  mercurial/thirdparty/cbor/docs/modules/encoder.rst
  mercurial/thirdparty/cbor/docs/modules/types.rst
  mercurial/thirdparty/cbor/docs/usage.rst
  mercurial/thirdparty/cbor/docs/versionhistory.rst
  mercurial/thirdparty/cbor/setup.cfg
  mercurial/thirdparty/cbor/setup.py
  mercurial/thirdparty/cbor/tests/test_decoder.py
  mercurial/thirdparty/cbor/tests/test_encoder.py
  mercurial/thirdparty/cbor/tests/test_types.py
  mercurial/thirdparty/cbor/tox.ini
  tests/test-check-py3-compat.t
  tests/test-check-pyflakes.t

CHANGE DETAILS

diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
--- a/tests/test-check-pyflakes.t
+++ b/tests/test-check-pyflakes.t
@@ -16,6 +16,7 @@
   $ testrepohg locate 'set:**.py or grep("^#!.*python")' \
   > -X hgext/fsmonitor/pywatchman \
   > -X mercurial/pycompat.py -X contrib/python-zstandard \
+  > -X mercurial/thirdparty/cbor \
   > 2>/dev/null \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
   
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -5,6 +5,7 @@
 
   $ testrepohg files 'set:(**.py)' \
   > -X hgdemandimport/demandimportpy2.py \
+  > -X mercurial/thirdparty/cbor \
   > | sed 's|\\|/|g' | xargs $PYTHON contrib/check-py3-compat.py
   contrib/python-zstandard/setup.py not using absolute_import
   contrib/python-zstandard/setup_zstd.py not using absolute_import
diff --git a/mercurial/thirdparty/cbor/tox.ini 
b/mercurial/thirdparty/cbor/tox.ini
deleted file mode 100644
--- a/mercurial/thirdparty/cbor/tox.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[tox]
-envlist = py27, py33, py34, py35, py36, pypy, pypy3, flake8
-skip_missing_interpreters = true
-
-[testenv]
-commands = python -m pytest {posargs}
-extras = test
-
-[testenv:flake8]
-deps = flake8
-commands = flake8 cbor2 tests
-skip_install = true
diff --git a/mercurial/thirdparty/cbor/tests/test_types.py 
b/mercurial/thirdparty/cbor/tests/test_types.py
deleted file mode 100644
--- a/mercurial/thirdparty/cbor/tests/test_types.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import pytest
-
-from cbor2.types import CBORTag, CBORSimpleValue
-
-
-def test_tag_repr():
-assert repr(CBORTag(600, 'blah')) == "CBORTag(600, 'blah')"
-
-
-def test_tag_equals():
-tag1 = CBORTag(500, ['foo'])
-tag2 = CBORTag(500, ['foo'])
-tag3 = CBORTag(500, ['bar'])
-assert tag1 == tag2
-assert not tag1 == tag3
-assert not tag1 == 500
-
-
-def test_simple_value_repr():
-assert repr(CBORSimpleValue(1)) == "CBORSimpleValue(1)"
-
-
-def test_simple_value_equals():
-tag1 = CBORSimpleValue(1)
-tag2 = CBORSimpleValue(1)
-tag3 = CBORSimpleValue(21)
-assert tag1 == tag2
-assert tag1 == 1
-assert not tag1 == tag3
-assert not tag1 == 21
-assert not tag2 == "21"
-
-
-def test_simple_value_too_big():
-exc = pytest.raises(TypeError, CBORSimpleValue, 256)
-assert str(exc.value) == 'simple value too big'
diff --git a/mercurial/thirdparty/cbor/tests/test_encoder.py 
b/mercurial/thirdparty/cbor/tests/test_encoder.py
deleted file mode 100644
--- a/mercurial/thirdparty/cbor/tests/test_encoder.py
+++ /dev/null
@@ -1,318 +0,0 @@
-import re
-from binascii import unhexlify
-from collections import OrderedDict
-from datetime import datetime, timedelta, date
-from decimal import Decimal
-from email.mime.text import MIMEText
-from fractions import Fraction
-from uuid import UUID
-
-import pytest
-
-from cbor2.compat import timezone
-from cbor2.encoder import dumps, CBOREncodeError, dump, shareable_encoder
-from cbor2.types import CBORTag, undefined, CBORSimpleValue
-
-
-@pytest.mark.parametrize('value, expected', [
-(0, '00'),
-(1, '01'),
-(10, '0a'),
-(23, '17'),
-(24, '1818'),
-(100, '1864'),
-(1000, '1903e8'),
-(100, '1a000f4240'),
-(1, '1b00e8d4a51000'),
-(18446744073709551615, '1b'),
-(18446744073709551616, 'c24901'),
-(-18446744073709551616, '3b'),
-(-18446744073709551617, 'c34901'),
-(-1, '20'),
-(-10, '29'),
-(-100, '3863'),
-(-1000, '3903e7')
-])
-def test_integer(value, expected):
-expected = unhexlify(expected)
-assert dumps(value) == expected
-
-