Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minijson
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
minijson
Commits
16e5da3b
Commit
16e5da3b
authored
3 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
fix deploy bug, v2.9
parent
a7750cd1
No related branches found
Branches containing commit
Tags
v1.0.3
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.travis.yml
+17
-1
17 additions, 1 deletion
.travis.yml
docs/changelog.md
+1
-1
1 addition, 1 deletion
docs/changelog.md
setup.cfg
+1
-1
1 addition, 1 deletion
setup.cfg
tests/test_minijson.py
+11
-13
11 additions, 13 deletions
tests/test_minijson.py
with
30 additions
and
16 deletions
.travis.yml
+
17
−
1
View file @
16e5da3b
...
...
@@ -90,6 +90,22 @@ jobs:
-
twine upload -u $PYPI_USER -p $PYPI_PWD *.whl
after_script
:
-
echo "Done"
-
stage
:
deploy
python
:
"
3.8"
arch
:
"
ppc64le"
before_script
:
-
sudo apt-get update
-
sudo apt-get install -y patchelf
-
pip install wheel auditwheel twine doctor-wheel cython
script
:
-
python setup.py bdist_wheel
-
cd dist
-
doctor-wheel *.whl
-
auditwheel repair --plat manylinux2014_ppc64le *.whl
-
cd wheelhouse
-
twine upload -u $PYPI_USER -p $PYPI_PWD *.whl
after_script
:
-
echo "Done"
-
stage
:
deploy
python
:
"
3.8"
arch
:
"
arm64"
...
...
@@ -101,7 +117,7 @@ jobs:
-
python setup.py bdist_wheel
-
cd dist
-
doctor-wheel *.whl
-
auditwheel repair --plat manylinux2014_
x86_
64 *.whl
-
auditwheel repair --plat manylinux2014_
arm
64 *.whl
-
cd wheelhouse
-
twine upload -u $PYPI_USER -p $PYPI_PWD *.whl
after_script
:
...
...
This diff is collapsed.
Click to expand it.
docs/changelog.md
+
1
−
1
View file @
16e5da3b
...
...
@@ -5,7 +5,7 @@ v2.9
----
*
minor refactor: code deduplication
*
fixed some bugs
on ARM
*
fixed some bugs
with unserializing ints on other platforms than x86_64
v2.8
----
...
...
This diff is collapsed.
Click to expand it.
setup.cfg
+
1
−
1
View file @
16e5da3b
# coding:
utf-8
[metadata]
version
= 2.9
a2
version
= 2.9
name
= minijson
long_description
= file: README.md
long_description_content_type
= text/markdown; charset=UTF-8
...
...
This diff is collapsed.
Click to expand it.
tests/test_minijson.py
+
11
−
13
View file @
16e5da3b
import
typing
as
tp
import
unittest
from
minijson
import
dumps
,
loads
,
dumps_object
,
loads_object
,
EncodingError
,
DecodingError
,
\
...
...
@@ -11,13 +12,6 @@ class TestMiniJSON(unittest.TestCase):
enc
.
encode
({
"
test
"
:
"
2
"
,
"
value
"
:
2
})
enc
.
encode
({
b
"
test
"
:
"
2
"
,
b
"
value
"
:
2
})
def
test_are_we_sane
(
self
):
self
.
assertTrue
(
-
128
<=
-
1
<=
127
)
def
test_arm_bug
(
self
):
b
=
dumps
(
-
1
)
self
.
assertEqual
(
b
,
b
'
\x03\xFF
'
)
def
test_encoder_overrided_default
(
self
):
class
Encoder
(
MiniJSONEncoder
):
def
default
(
self
,
v
):
...
...
@@ -66,8 +60,12 @@ class TestMiniJSON(unittest.TestCase):
def
assertLoadingIsDecodingError
(
self
,
b
:
bytes
):
self
.
assertRaises
(
DecodingError
,
lambda
:
loads
(
b
))
def
assertSameAfterDumpsAndLoads
(
self
,
c
):
self
.
assertEqual
(
loads
(
dumps
(
c
)),
c
)
def
assertSameAfterDumpsAndLoads
(
self
,
c
,
repres
:
tp
.
Optional
[
bytes
]
=
None
):
b
=
dumps
(
c
)
if
repres
is
not
None
:
self
.
assertEqual
(
b
,
repres
)
d
=
loads
(
b
)
self
.
assertEqual
(
c
,
d
)
def
test_default_returns_nonjsonable
(
self
):
"""
Assert that if transform returns a non-JSONable value, EncodingError is raised
"""
...
...
@@ -178,10 +176,10 @@ class TestMiniJSON(unittest.TestCase):
self
.
assertSameAfterDumpsAndLoads
({
'
a
'
*
300
:
2
})
def
test_negatives
(
self
):
self
.
assertSameAfterDumpsAndLoads
(
-
1
)
self
.
assertSameAfterDumpsAndLoads
(
-
259
)
self
.
assertSameAfterDumpsAndLoads
(
-
0x7FFF
)
self
.
assertSameAfterDumpsAndLoads
(
-
0xFFFF
)
self
.
assertSameAfterDumpsAndLoads
(
-
1
,
b
'
\x03\xFF
'
)
self
.
assertSameAfterDumpsAndLoads
(
-
259
,
b
'
\x02\xfe\xfd
'
)
self
.
assertSameAfterDumpsAndLoads
(
-
0x7FFF
,
b
'
\x02\x80\x01
'
)
self
.
assertSameAfterDumpsAndLoads
(
-
0xFFFF
,
b
'
\x01\xff\xff\x00\x01
'
)
self
.
assertSameAfterDumpsAndLoads
(
0x1FFFF
)
self
.
assertSameAfterDumpsAndLoads
(
0xFFFFFFFF
)
self
.
assertSameAfterDumpsAndLoads
(
0x1FFFFFF
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment