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

finalizing paths.json spec #1535

Merged
merged 30 commits into from
Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e27aa17
Some edits to files.json
soapy1 Nov 15, 2016
451d571
Create NodeType and FileMode Enums
soapy1 Nov 15, 2016
1248ff4
Rename file_type to node_type
soapy1 Nov 15, 2016
ba9e4fb
Add docstring for additional enums
soapy1 Nov 15, 2016
436f034
Refactor NodeType
soapy1 Nov 15, 2016
c7f3e2f
Rename file_type method to node_type
soapy1 Nov 15, 2016
48f37c7
Import NodeType and FileMode from conda
soapy1 Nov 15, 2016
59f3b78
JSON encode node_type
soapy1 Nov 15, 2016
341c580
Include CrossPlatformStLink
soapy1 Nov 15, 2016
511a5e7
Json dump with EntityEncoder
soapy1 Nov 15, 2016
2dad147
Fix tests
soapy1 Nov 16, 2016
2e5cabf
Fix tests
soapy1 Nov 16, 2016
6b463cd
accurate names; pk ids sorted to top
kalefranz Nov 17, 2016
7442b61
Some edits to files.json
soapy1 Nov 15, 2016
c4f473c
Create NodeType and FileMode Enums
soapy1 Nov 15, 2016
8b31403
Add docstring for additional enums
soapy1 Nov 15, 2016
5876d8b
Import NodeType and FileMode from conda
soapy1 Nov 15, 2016
5125e15
JSON encode node_type
soapy1 Nov 15, 2016
44c8342
Include CrossPlatformStLink
soapy1 Nov 15, 2016
17ac64a
Fix tests
soapy1 Nov 16, 2016
dbc044f
Fix tests
soapy1 Nov 28, 2016
dd25642
Merge branch 'master' into files-json-review
soapy1 Dec 12, 2016
ab51199
Add test for conda master to travis
soapy1 Dec 15, 2016
4af5fa3
Better messages on win errors
soapy1 Dec 15, 2016
de6b424
Test conda interface enums/classes
soapy1 Dec 15, 2016
b7d7ba3
Update travis to test against conda canary
soapy1 Dec 15, 2016
e67d419
Import PathType for conda instead of NodeType
soapy1 Dec 15, 2016
47b9136
Add test for st_nlink on win
soapy1 Dec 15, 2016
1689e70
Merge branch 'master' into files-json-review
soapy1 Dec 16, 2016
e9885a1
Skip crossplatform_st_link_on_win if not on win
soapy1 Dec 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
soapy1 committed Dec 5, 2016
commit 2dad147df9fdc21f87cf8a9536e3de6c7d143026
2 changes: 1 addition & 1 deletion conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def build_info_files_json(m, prefix, files, files_with_prefix):


def create_info_files_json_v1(m, info_dir, prefix, files, files_with_prefix):
files_json_fields = ["path", "sha256", "size_in_bytes", "file_type", "file_mode",
files_json_fields = ["path", "sha256", "size_in_bytes", "node_type", "file_mode",
"prefix_placeholder", "no_link", "inode_paths"]
files_json_files = build_info_files_json(m, prefix, files, files_with_prefix)
files_json_info = {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def test_info_files_json(test_config):
assert package_has_file(fn, "info/files.json")
with tarfile.open(fn) as tf:
data = json.loads(tf.extractfile('info/files.json').read().decode('utf-8'))
fields = ["path", "sha256", "size_in_bytes", "file_type", "file_mode", "no_link",
fields = ["path", "sha256", "size_in_bytes", "node_type", "file_mode", "no_link",
"prefix_placeholder", "inode_paths"]
for key in data.keys():
assert key in ['files', 'fields', 'version']
Expand Down
50 changes: 26 additions & 24 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from conda_build import build, api, __version__
from conda_build.metadata import MetaData
from conda_build.utils import rm_rf, on_win
from conda_build.conda_interface import NodeType

from .utils import (testing_workdir, test_config, test_metadata, metadata_dir,
get_noarch_python_meta, put_bad_conda_on_path)
Expand Down Expand Up @@ -215,20 +216,21 @@ def test_create_info_files_json(testing_workdir, test_metadata):
files_with_prefix = [("prefix/path", "text", "foo")]
files = ["one", "two", "foo"]

build.create_info_files_json(test_metadata, info_dir, testing_workdir, files, files_with_prefix)
build.create_info_files_json_v1(test_metadata, info_dir, testing_workdir, files, files_with_prefix)
files_json_path = os.path.join(info_dir, "files.json")
expected_output = {
"files": [{"file_type": "hardlink", "path": "one",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0},
{"file_type": "hardlink", "path": "two", "size_in_bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},
{"file_mode": "text", "file_type": "hardlink",
"path": "foo", "prefix_placeholder": "prefix/path",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0}],
"fields": ["path", "sha256", "size_in_bytes", "file_type", "file_mode",
"prefix_placeholder", "no_link", "inode_first_path"],
"files": [{"file_mode": "text", "node_type": "hardlink", "path": "foo",
"prefix_placeholder": "prefix/path",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0},
{"node_type": "hardlink", "path": "one",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0},
{"node_type": "hardlink", "path": "two",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0}],
"fields": ["path", "sha256", "size_in_bytes", "node_type", "file_mode",
"prefix_placeholder", "no_link", "inode_paths"],
"version": 1}
with open(files_json_path, "r") as files_json:
output = json.load(files_json)
Expand All @@ -251,25 +253,25 @@ def test_create_info_files_json_no_inodes(testing_workdir, test_metadata):
files_with_prefix = [("prefix/path", "text", "foo")]
files = ["one", "two", "one_hl", "foo"]

build.create_info_files_json(test_metadata, info_dir, testing_workdir, files, files_with_prefix)
build.create_info_files_json_v1(test_metadata, info_dir, testing_workdir, files, files_with_prefix)
files_json_path = os.path.join(info_dir, "files.json")
expected_output = {
"files": [{"inode_paths": ["one", "one_hl"], "file_type": "hardlink", "path": "one",
"files": [{"file_mode": "text", "node_type": "hardlink", "path": "foo",
"prefix_placeholder": "prefix/path",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0},
{"file_type": "hardlink", "path": "two", "size_in_bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},
{"inode_paths": ["one", "one_hl"], "file_type": "hardlink",
"path": "one_hl",
{"node_type": "hardlink", "path": "one",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0},
{"file_mode": "text", "file_type": "hardlink", "path": "foo",
"prefix_placeholder": "prefix/path",
{"node_type": "hardlink", "path": "one_hl",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0},
{"node_type": "hardlink", "path": "two",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size_in_bytes": 0}],
"fields": ["path", "sha256", "size_in_bytes", "file_type", "file_mode",
"prefix_placeholder", "no_link", "inode_first_path"],

"fields": ["path", "sha256", "size_in_bytes", "node_type", "file_mode",
"prefix_placeholder", "no_link", "inode_paths"],
"version": 1}
with open(files_json_path, "r") as files_json:
assert json.load(files_json) == expected_output
output = json.load(files_json)
assert output == expected_output