Skip to content

Commit

Permalink
Add @nxlv/python initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvieirasilva committed Mar 1, 2022
1 parent 81f1478 commit c1e3cbf
Show file tree
Hide file tree
Showing 99 changed files with 5,278 additions and 349 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @nxlv/nx-plugins

## What is Nx

🔎 Extensible Dev Tools for Monorepos.

## Plugins available

- [@nxlv/nx-plugins](packages/nx-python/README.md)
File renamed without changes.
File renamed without changes.
86 changes: 86 additions & 0 deletions e2e/nx-python-e2e/tests/nx-python.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import {
ensureNxProject,
readJson,
runNxCommandAsync,
updateFile,
checkFilesExist,
} from '@nrwl/nx-plugin/testing';
describe('nx-python e2e', () => {
it('should create nx-python project', async (done) => {
const app1 = 'app1';
const lib1 = 'lib1';
ensureNxProject('@nxlv/python', 'dist/packages/nx-python');

const nxJson = readJson('nx.json');
nxJson.plugins = ['@nxlv/nx-python'];

updateFile('nx.json', JSON.stringify(nxJson, null, 4));

await runNxCommandAsync(
`generate @nxlv/python:project ${app1} --type "application"`
);

await runNxCommandAsync(
`generate @nxlv/python:project ${lib1} --type "library"`
);

await runNxCommandAsync(`run ${app1}:add --name ${lib1} --local`);

await runNxCommandAsync(`run ${lib1}:add --name pendulum`);

await runNxCommandAsync(`run ${app1}:lint`);

await runNxCommandAsync(`run ${app1}:build`);

expect(() =>
checkFilesExist(
`apps/${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
`apps/${app1}/dist/${app1}-1.0.0.tar.gz`
)
).not.toThrow();

done();
}, 3000000);

it('should create nx-python project with 3 levels', async (done) => {
const app1 = 'app1';
const lib1 = 'lib1';
const lib2 = 'lib2';

ensureNxProject('@nxlv/python', 'dist/packages/nx-python');

const nxJson = readJson('nx.json');
nxJson.plugins = ['@nxlv/python'];

updateFile('nx.json', JSON.stringify(nxJson, null, 4));

await runNxCommandAsync(
`generate @nxlv/python:project ${app1} --type "application"`
);

await runNxCommandAsync(
`generate @nxlv/python:project ${lib1} --type "library"`
);

await runNxCommandAsync(
`generate @nxlv/python:project ${lib2} --type "library"`
);

await runNxCommandAsync(`run ${lib1}:add --name ${lib2} --local`);

await runNxCommandAsync(`run ${app1}:add --name ${lib1} --local`);

await runNxCommandAsync(`run ${lib2}:add --name numpy`);

await runNxCommandAsync(`run ${app1}:build`);

expect(() =>
checkFilesExist(
`apps/${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
`apps/${app1}/dist/${app1}-1.0.0.tar.gz`
)
).not.toThrow();

done();
}, 3000000);
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
94 changes: 0 additions & 94 deletions lucasvieira/README.md

This file was deleted.

44 changes: 0 additions & 44 deletions lucasvieira/e2e/nx-python-e2e/tests/nx-python.spec.ts

This file was deleted.

7 changes: 0 additions & 7 deletions lucasvieira/packages/nx-python/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions lucasvieira/packages/nx-python/executors.json

This file was deleted.

12 changes: 0 additions & 12 deletions lucasvieira/packages/nx-python/generators.json

This file was deleted.

7 changes: 0 additions & 7 deletions lucasvieira/packages/nx-python/package.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c1e3cbf

Please sign in to comment.