mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 10:47:35 -05:00
Import PyScript Version into Python Runtime (#958)
* Import current version as PyScript.__version__ and PyScript.version_info * Add integration, python unit tests * Mock pyscript.py with __mocks__/pyscript.js to make jest tests happy
This commit is contained in:
14
pyscriptjs/__mocks__/_pyscript.js
Normal file
14
pyscriptjs/__mocks__/_pyscript.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* this file mocks the `src/python/pyscript.py` file
|
||||
* since importing of `.py` files isn't usually supported
|
||||
* inside JS/TS files.
|
||||
*
|
||||
* It sets the value of whatever is imported from
|
||||
* `src/python/pyscript.py` the contents of that file
|
||||
*
|
||||
* This is needed since the imported object is further
|
||||
* passed to a function which only accepts a string.
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
module.exports = fs.readFileSync('./src/python/pyscript.py', 'utf8');
|
||||
Reference in New Issue
Block a user