2011-08-30 02:37:25 +02:00
|
|
|
[tox]
|
2020-10-28 13:11:06 +01:00
|
|
|
envlist = py36, py37, py38, py39, pypy3
|
2012-12-02 01:15:18 +01:00
|
|
|
|
2011-08-30 02:37:25 +02:00
|
|
|
[testenv]
|
2020-11-16 03:08:58 +01:00
|
|
|
deps=-r{toxinidir}/requirements/test.pip
|
2020-10-09 02:37:39 +02:00
|
|
|
allowlist_externals=
|
2018-03-07 02:59:35 +01:00
|
|
|
/bin/sh
|
2020-10-09 02:37:39 +02:00
|
|
|
sitepackages=False
|
|
|
|
commands=
|
|
|
|
/bin/sh -c "{env:PYPISERVER_SETUP_CMD:true}"
|
Use argparse config throughout app (#349)
This PR is a pretty substantial refactor of the entrypoints of pypiserver (`__main__` and `__init__`) to use the argparse-based config added in #339.
- Updated `RunConfig` and `UpdateConfig` classes to have exclusive init kwargs, instead of taking an namespace. This turned out to be much easier when working with the library-style app initialization in `__init__`, both for direct instantiation and via paste config
- Added an `iter_packages()` method to the `RunConfig` to iterate over packages specified by the configuration (note @elfjes, I think that replacing this with e.g. a `backend` reference will be a nice way to tie in #348)
- Added a general-purpose method to map legacy keyword arguments to the `app()` and `paste_app_factory()` functions to updated forms
- Refactored the `paste_app_factory()` to not mutate the incoming dictionary
- Removed all argument-parsing and config-related code from `__main__` and `core`
- Moved `_logwrite` from `__init__` to `__main__`, since that was the only place it was being used after the updates to `core`
- Updated `digest_file` to use `hashlib.new(algo)` instead of `getattr(hashlib, algo)`, because the former supports more algorithms
- Updated `setup.py` to, instead of calling `eval()` on the entirety of `__init__`, to instead just evaluate the line that defines the version
- Assigned the config to a `._pypiserver_config` attribute on the `Bottle` instance to reduce hacky test workarounds
- Fixed the tox config, which I broke in #339
* Config: add auth & absolute path resolution
* Config: check pkg dirs on config creation
* Instantiate config with kwargs, not namespace
* WIP: still pulling the threads
* Init seems to be working
* tests passing locally, still need to update cache
* Fix tox command
* unused import
* Fix typing
* Be more selective in exec() in setup.py
* Require accurate casing for hash algos
* Remove old comment
* Comments, minor updates and simplifications
* move _logwrite to a more reasonable place
* Update config to work with cache
* Type cachemanager listdir in core
* Update config module docstring, rename method
* Add more comments re: paste config
* Add comments to main, remove unneded check
* Remove commented code
* Use {posargs} instead of [] for clarity in tox
* Add dupe check for kwarg updater
* Remove unused references on app instance
* Fix typo
* Remove redundancy in log level parsing
2020-10-26 00:48:28 +01:00
|
|
|
pytest --cov=pypiserver {posargs}
|
2020-10-09 02:37:39 +02:00
|
|
|
|
2012-12-02 01:37:01 +01:00
|
|
|
|
2013-01-04 02:09:11 +01:00
|
|
|
[pytest]
|
2017-11-14 17:47:27 +01:00
|
|
|
norecursedirs = bin parts develop-eggs eggs venv .* _* CVS {args}
|
2018-03-07 02:59:35 +01:00
|
|
|
|
|
|
|
[testenv:pre_twine]
|
|
|
|
# Allow calling ``tox -e pre_twine`` to test pypiserver with the most
|
|
|
|
# recent prerelease of twine.
|
2020-10-09 02:37:39 +02:00
|
|
|
allowlist_externals=
|
2018-03-07 02:59:35 +01:00
|
|
|
tox
|
|
|
|
setenv=
|
|
|
|
PYPISERVER_SETUP_CMD=pip install --upgrade --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple twine
|
|
|
|
commands=
|
|
|
|
tox
|