diff --git a/.gitignore b/.gitignore index b84f0c51..fb8d6c63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /node_modules/ __pycache__/ *.pyc +npm-debug.log +test/.venvs/ diff --git a/test/inspect.test.js b/test/inspect.test.js index 9eb28433..82a1808c 100644 --- a/test/inspect.test.js +++ b/test/inspect.test.js @@ -206,7 +206,6 @@ test('transitive dep not installed, but with allowMissing option', t.ok(pkg, 'package'); t.equal(pkg.name, 'pip-app', 'name'); t.equal(pkg.version, '0.0.0', 'version'); - // t.equal(pkg.full, 'pip-app@0.0.0', 'full'); // do we need this? t.end(); }); @@ -321,7 +320,7 @@ test('uses provided exec command', function (t) { }); }); -test('package name differs from requirement', function (t) { +test('package name differs from requirement (- vs _)', function (t) { return Promise.resolve().then(function () { chdirWorkspaces('pip-app-deps-with-dashes'); var venvCreated = testUtils.ensureVirtualenv('pip-app-deps-with-dashes'); @@ -347,6 +346,30 @@ test('package name differs from requirement', function (t) { }); }); +test('package name differs from requirement (- vs .)', function (t) { + t.pass('Not implemented yet'); + t.end(); +}); + +test('package installed conditionally based on python version', function (t) { + return Promise.resolve().then(function () { + chdirWorkspaces('pip-app-with-python-markers'); + var venvCreated = testUtils.ensureVirtualenv('pip-app-with-python-markers'); + t.teardown(testUtils.activateVirtualenv('pip-app-with-python-markers')); + if (venvCreated) { + testUtils.pipInstall(); + } + }) + .then(function () { + return plugin.inspect('.', 'requirements.txt'); + }) + .then(function (result) { + var pkg = result.package; + t.notOk(pkg.dependencies.enum34, 'enum34 dep ignored'); + t.end(); + }); +}); + test('package depends on platform', function (t) { return Promise.resolve().then(function () { chdirWorkspaces('pip-app-deps-conditional'); diff --git a/test/workspaces/pip-app-with-python-markers/requirements.txt b/test/workspaces/pip-app-with-python-markers/requirements.txt new file mode 100644 index 00000000..68498498 --- /dev/null +++ b/test/workspaces/pip-app-with-python-markers/requirements.txt @@ -0,0 +1,25 @@ +amqp==2.4.2 +apscheduler==3.6.0 +asn1crypto==0.24.0 +astroid==1.6.6 +atomicwrites==1.3.0 +attrs==19.1.0 +automat==0.7.0 +backports.functools-lru-cache==1.5 ; python_version < '3.2' +billiard==3.6.0.0 +celery==4.3.0 +certifi==2019.3.9 +cffi==1.12.3 +chardet==3.0.4 +click==7.0 +clickclick==1.2.2 +configparser==3.7.4 ; python_version == '2.7' +connexion[swagger-ui]==2.2.0 +constantly==15.1.0 +cryptography==2.6.1 +cssselect==1.0.3 +cython==0.29.7 +enum34==1.1.6 ; python_version < '2.6' +fastavro==0.21.21 +flask-apscheduler==1.11.0 +flask==1.0.2