Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b016561
Fix R2016b and add toolbox packaging.
guzman-raphael Sep 19, 2020
058227c
Move compareVersions to its maintained toolbox, rename setupDJ to +dj…
guzman-raphael Sep 22, 2020
089051f
Update tests and add compiled toolbox.
guzman-raphael Sep 22, 2020
cbe5502
Merge pull request #284 from guzman-raphael/package-main
guzman-raphael Sep 22, 2020
66d4ce8
Create Documents folder as MATLAB will not ccreate it for userpath to…
guzman-raphael Sep 23, 2020
54bcf82
Merge pull request #286 from guzman-raphael/package-main
guzman-raphael Sep 23, 2020
0d2d26b
Use version-pinned MySQL8 (known issue).
guzman-raphael Sep 23, 2020
521d773
Merge pull request #287 from guzman-raphael/package-main
guzman-raphael Sep 23, 2020
90ea78e
Update readme.
guzman-raphael Sep 23, 2020
c5bf8b4
Merge pull request #288 from guzman-raphael/package-main
guzman-raphael Sep 23, 2020
621cf3a
Add FileExchange badge.
guzman-raphael Sep 23, 2020
1772969
Merge pull request #289 from guzman-raphael/package-main
guzman-raphael Sep 23, 2020
2c263f0
Pull into prompts GHToolbox dependency handling (via GitHub).
guzman-raphael Oct 6, 2020
f6a37af
Merge pull request #290 from guzman-raphael/package-main
guzman-raphael Oct 6, 2020
09b6f6b
Update mym pointer to prod, update version, update changelog.
guzman-raphael Oct 15, 2020
ecf487d
Merge pull request #294 from guzman-raphael/package-main
guzman-raphael Oct 15, 2020
66cb341
Remove toolbox binary from tracking.
guzman-raphael Oct 16, 2020
f6c6888
Merge pull request #295 from guzman-raphael/package-main
guzman-raphael Oct 16, 2020
ea1c494
Merge pull request #285 from datajoint/stage2
Oct 16, 2020
717f0af
Merge branch 'master' of github.com:datajoint/datajoint-matlab into s…
guzman-raphael Oct 26, 2020
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
100 changes: 0 additions & 100 deletions +dj/+lib/compareVersions.m

This file was deleted.

11 changes: 1 addition & 10 deletions +dj/Connection.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@
% specify the connection to the database.
% initQuery is the SQL query to be executed at the start
% of each new session.
setupDJ(true);
try
mymVersion = mym('version');
assert(mymVersion.major > 2 || mymVersion.major==2 && mymVersion.minor>=6)
catch
error 'Outdated version of mYm. Please upgrade to version 2.6 or later'
end
if verLessThan('matlab', '8.6')
error 'MATLAB version 8.6 (R2015b) or greater is required'
end
dj.setup('prompt', ~dj.set('suppressPrompt'));
self.host = host;
self.user = username;
self.password = password;
Expand Down
1 change: 0 additions & 1 deletion +dj/conn.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
end
end
else
% invoke setupDJ
% optional environment variables specifying the connection.
env = struct(...
'host', 'DJ_HOST', ...
Expand Down
80 changes: 80 additions & 0 deletions +dj/setup.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
function setup(varargin)
p = inputParser;
addOptional(p, 'force', false);
addOptional(p, 'prompt', true);
parse(p, varargin{:});
force = p.Results.force;
prompt = p.Results.prompt;
persistent INVOKED
if ~isempty(INVOKED) && ~force
return
end
% check MATLAB
if verLessThan('matlab', '9.1')
error('DataJoint:System:UnsupportedMatlabVersion', ...
'MATLAB version 9.1 (R2016b) or greater is required');
end
% require certain toolboxes
requiredToolboxes = {...
struct(...
'Name', 'GHToolbox', ...
'ResolveTarget', 'datajoint/GHToolbox'...
), ...
struct(...
'Name', 'mym', ...
'ResolveTarget', 'datajoint/mym', ...
'Version', @(v) compareVersions(v, '2.7.3', @(v_actual,v_ref) v_actual>=v_ref)...
)...
};
try
ghtb.require(requiredToolboxes, 'prompt', prompt);
catch ME
installPromptMsg = {
'Toolbox ''%s'' did not meet the minimum requirements.'
'Would you like to proceed with an upgrade?'
};
if strcmp(ME.identifier, 'MATLAB:undefinedVarOrClass') && (~prompt || strcmpi('yes',...
dj.internal.ask(sprintf(sprintf('%s\n', installPromptMsg{:}), 'GHToolbox'))))
% fetch
tmp_toolbox = [tempname '.mltbx'];
websave(tmp_toolbox, ['https://github.com/' requiredToolboxes{1}.ResolveTarget ...
'/releases/download/' ...
subsref(webread(['https://api.github.com/repos/' ...
requiredToolboxes{1}.ResolveTarget ...
'/releases/latest'], ...
weboptions('Timeout', 60)), ...
substruct('.', 'tag_name')) ...
'/GHToolbox.mltbx'], weboptions('Timeout', 60));
% install
try
matlab.addons.install(tmp_toolbox, 'overwrite');
catch ME
if strcmp(ME.identifier, 'MATLAB:undefinedVarOrClass')
matlab.addons.toolbox.installToolbox(tmp_toolbox);
else
rethrow(ME);
end
end
% remove temp toolbox file
delete(tmp_toolbox);
% retrigger dependency validation
ghtb.require(requiredToolboxes, 'prompt', prompt);
elseif strcmp(ME.identifier, 'MATLAB:undefinedVarOrClass')
GHToolboxMsg = {
'Toolbox ''GHToolbox'' did not meet the minimum requirements.'
'Please proceed to install it.'
};
error('DataJoint:verifyGHToolbox:Failed', ...
sprintf('%s\n', GHToolboxMsg{:}));
else
rethrow(ME)
end
end
% check mym
mymVersion = mym('version');
assert(mymVersion.major > 2 || mymVersion.major==2 && mymVersion.minor>=6, ...
'DataJoint:System:mYmIncompatible', ...
'Outdated version of mYm. Please upgrade to version 2.6 or later');
% set cache
INVOKED = true;
end
2 changes: 1 addition & 1 deletion +dj/version.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function varargout = version
% report DataJoint version

v = struct('major',3,'minor',3,'bugfix',1);
v = struct('major',3,'minor',3,'bugfix',2);

if nargout
varargout{1}=v;
Expand Down
100 changes: 0 additions & 100 deletions +tests/+lib/compareVersions.m

This file was deleted.

5 changes: 0 additions & 5 deletions +tests/Main.m

This file was deleted.

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
*.m~
mym/
*.mltbx
*.env
notebook
*getSchema.m
docker-compose.yml
.vscode
matlab.prf
win.*
macos.*
macos.*
*.prj
*.mltbx
Empty file removed .gitmodules
Empty file.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- <<: *slim
env:
- MATLAB_VERSION: R2019a
- MYSQL_TAG: 8.0
- MYSQL_TAG: 8.0.18
- <<: *slim
env:
- MATLAB_VERSION: R2019a
Expand All @@ -36,4 +36,8 @@ jobs:
- <<: *slim
env:
- MATLAB_VERSION: R2018b
- MYSQL_TAG: 5.7
- <<: *slim
env:
- MATLAB_VERSION: R2016b
- MYSQL_TAG: 5.7
Loading