ChatExchange icon indicating copy to clipboard operation
ChatExchange copied to clipboard

Make developer dependencies optional

Open banksJeremy opened this issue 10 years ago • 5 comments

As discussed in chat here, pytest eventually shouldn't be a strict dependency for this project. It should still be defined in setup.py, but as optional, either as an extra or through some other mechanism.

banksJeremy avatar Apr 30 '14 05:04 banksJeremy

It doesn't look like there's any specific way of indicating dev dependencies as with Node, so a [dev] extra as implemented in fc8d339 seems like the appropriate approach.

It might be nice if we could have a second, distinct, Travis test build, which tries installing the non-dev dependencies and running a simple example script, but I worry that that's a slippery slope to lots of disorganized testing so I probably won't pursue it.

banksJeremy avatar Apr 30 '14 15:04 banksJeremy

(Although if we did want to go down that road, I think it might just take something like this (docs):)

matrix:
  include:
    - install: 'pip install .'
    - script: 'python examples/something.py'
  include:
    - install: 'pip install .[dev]'
    - script: 'python -m pytest'

banksJeremy avatar Apr 30 '14 15:04 banksJeremy

The build of fc8d339 failed on Travis. I am guessing there might be an issue with using extras with a non-editable installation of a local path:

(from .travis.yml, doesn't work, it thinks I want a packaged name ".[dev]")
pip install .[dev]

as opposed to calling

(works locally, as make install-dev-dependencies)
pip install -e .[dev]

or

(well-documented usage)
pip install ChatExchange[dev]

banksJeremy avatar Apr 30 '14 15:04 banksJeremy

I've filed a ticket about this behaviour at https://github.com/pypa/pip/issues/1780, which should clear up whether this is a bug or expected.

banksJeremy avatar Apr 30 '14 16:04 banksJeremy

Is this still relevant? I don't understand the distinction between "extra" and "optional" here. It should be easy to build a Github Action which tests without the dev dependencies (other than pytest, but how would you avoid importing that?)

tripleee avatar Oct 22 '23 13:10 tripleee