1

I have set up a little Python project that builds some docs and tests it with Travis CI.

Now I want to add an English linter to my project, but the ones I've found that seem interesting are in Node.js.

Is there a way to make calls to Node.js packages from a Python script? Or call an Node.js package from a Travis YAML file that's configured for Python?

1
  • 1
    You can do this with the built-in subprocess module. Do you just need to run the node module, or run it and capture its output on the Python side? Commented Jul 23, 2017 at 15:00

1 Answer 1

1

It turns out you can call Node.js from Travis directly:

language: python
branches:
  only:
  - master
python:
  - '2.7'
before_install:
  - wget https://raw.githubusercontent.com/creationix/nvm/v0.31.0/nvm.sh -O ~/.nvm/nvm.sh
  - source ~/.nvm/nvm.sh
  - nvm install 5 # For Node.js v5
  - node --version
install:
  - pip install -U pip
  - pip install -r requirements.txt
  - npm install ...
script:
  - make ...
  - call npm stuff here
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.