Commit Graph

29 Commits

Author SHA1 Message Date
Michal Szczepanski 4ddfc3a077 feat: add local pypi package mirror (#333) 2024-04-15 14:58:39 +02:00
Mitja O 2f0a56c380
fix: support Python 3.12 (#539)
* chore: pin explicit Python 3.12

* chore: add a `test-python` for stable Python

* chore: empty commit

* chore: add some FIXMEs

* chore: add `packaging`

* chore(wip): replace `LegacyVersion` with `packaging`'s `parse`

* chore(wip): bypass `strtobool` usage

* chore(wip): `pkg_resources` are deprecated

* chore(wip): naive way to support Python <3.12

* chore(wip): swap import order

* chore(wip): try fixing version check

* chore: add a fixme

* chore(wip): reverse legacy pip check

* chore(wip): legacy pip  check for 9 or lower

* fix: fix the legacy pip check

* chore: small cleanup

* chore(wip): try the `importlib_resources`

* chore: add small comment

* chore(wip): avoid `setup.py` in fixtures

* chore(wip): version-compatible wheel build

* chore: install `build` for `3.8` too

* fix: mypy issues

* chore: fix comments

* fix: more formatting fixes

* fix: mdformat

* fix: pass wrong auth to `failed_auth` test

* chore: cleanup packages before and after test runs

* chore(wip): try to bypass test error

* chore: add a tech debt comment

* chore: undo too many changes

* chore(wip): small debug experiment

* chore(wip): skip some tests

* chore(wip): use nonsense code

* fix(chore): small fix to the nonsense code

* chore(wip): try `--force-reinstall`

* chore: finalize the docker tests
2024-04-01 21:30:02 +02:00
dependabot[bot] 946fbfe64e
chore: Update setuptools requirement from <62.0.0,>=40.0 to >=40.0,<70.0.0 in /requirements (#557)
chore: Update setuptools requirement in /requirements

Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v40.0.0...v69.2.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 12:14:44 +02:00
Glenn 9edae77659
Feature/markdown conversion (#503)
* feat: markdown conversion

logo and badges

* feat: markdown conversion

fix logo path

* feat: markdown

table changes

* feat: markdown

table alignment

* feat: markdown

check toc

* feat: markdown

toc additions

* feat: markdown

quickstart section

* feat: dependabot

more details section in quick start

* feat: dependabot

correct bold

* feat: markdown

client side config, pip

* feat: markdown

typo in title

* feat: markdown

typo in configuring pip

* feat: markdown

apache like authentication section
an initial cut to view the markdown
in github

* feat: markdown

typo in markdown link

* feat: markdown

remove trailing colon

* feat: markdown

typo in shell markdown

* feat: markdown

standardize on 4 space indent in shell code block

* feat: markdown

complete markdown for section up to alternate installation methods

* feat: markdown

add more of the contents to test with

* feat: markdown

contents

* feat: markdown

contents

* feat: markdown

contents

* feat: markdown
dquote>
dquote> recipes

* feat: markdown
dquote>
dquote> recipes

* feat: markdown
dquote>
dquote> up to licensing

* feat: markdown
dquote>
dquote> contents

* Update README.md

Missing exclamation mark

* Update README.md

missing link

* Update README.md

remove duplicated text

* Update README.md

bold differences it Table of contents

* Update README.md

additional bold changes in table of contents

* Update README.md

broken link

* Update README.md

typo in link fix

* Update README.md

change code block to text as shell highlighting was showing some items in red

* Update README.md

code block shell to text

* Update README.md

correct pypi-server update section

* feat: markdown
dquote>
dquote> link back to TOC title

* Update README.md

change link to TOC title

* Update README.md

link test

* Update README.md

link update

* Update README.md

link update

* Update README.md

link update

* feat: markdown

links

* Update README.md

change the level of indent for uploading packages remotely

* Update README.md

add link to python-pam

* feat: markdown

apache link to TOC not working.

* Update README.md

grammar

* Update README.md

typo bold

* feat: markdown

undo bolded text in TOC and titles as linking does
not work

* feat: markdown

remove bold from TOC

* feat: feature

more link issues

* feat: markdown

fixing broken links

* feat: markdown

change text slightly as markdown only links to plain text

* feat: markdown

typo

* feat: markdown

more link typos

* Update README.md

typo in link

* Update README.md

link will not work with braces in the titles

* feat: markdown

run mdformat and apply changes, :) lint!

* feat:  markdown

- check via mdformat
- remove old check script
- update test-requirements.txt

* feat: markdown

correct the errors in the mdformat run command

* feat: markdown

for testing remove all the actual jobs

* feat: markdown

re-run mdformat

* feat: markdown

put the jobs back in after testing the mdformat
cmd for passing and failing via workflow dispatch

* feat: markdown

remove references to README.md

* feat: markdown

change action to workflow dispatch for testing

* feat: markdown

- update docker igore
- alter unit test to look for version number after md changes

* feat: markdown

black linting

* feat: markdown

update comments

* feat: markdown

update bumpver to look at md rather than rst file

* feat: markdown

replace workflow dispatch with pull request
to get ready for the final PR

* feat: markdown-delete-original

delete the original rst file

* feat: markdown-delete-original

change ci to workflow dispatch for testing

* feat: markdown-delete-original

revert workflow dispatch

* feat: markdown-badge-links

set the links back to the original
URLs.

* feat: markdown-badge-links

fix brackets

* feat: markdown

update the version and date

* feat: markdown conversion

markdown changes to conform to mdformat tooling.
2023-08-15 11:16:30 +02:00
Glenn 85e065e1ad
Feat/dependabot (#493)
* feat: dependabot

- add dependabot yml file to look in the docker & requirements folders
- split the requirements out of the test.pip into a test-requirements.pip file so dependabot recognizes it

It was found that in order to have the python dependabot
recognize the requirements a naming convention had to be
followed

* feat: dependabot

alter to monthly
2023-06-23 17:15:46 +00:00
Christian Clauss abc4bfb418
Upgrade to psf/black stable style 2023 (#474)
* Upgrade to psf/black stable style 2023

* Unpin psf/black
2023-02-02 13:08:09 +01:00
Dmitrii O 383c936fb8
chore: disable tests on Python3.6 (#471) 2023-02-02 12:44:46 +01:00
Dmitrii Orlov cd1e17cc26
fix(setuptools-in-tests): add `packages=[]` in test setup (#425)
* fix: add `packages=[]` in test setup

* pin setuptools below 62 for tests
2022-03-31 10:09:16 +02:00
Matthew Planchard 8306de15db
Gunicorn/gevent docker, log fixes, cache busting (#371)
Updates the Docker configuration to use the gunicorn server with gevent
workers by default. Adds `waitress` to the docker container, so that if
no server is specified, we will fall back to that rather than `wsgiref`.

Making this happen brought a few other issues to light, which are also
addressed here.

- Docker log output not immediately being flushed to stdout (#358):
  resolved by setting the `PYTHONUNBUFFERED` env var to `t` in the
  docker container
- When the WSGIRef server is selected, its access logs are written
  directly to stderr, rather than going through the logging machinery:
  resolved by adding a new `WsgiHandler` class and passing in to
  bottle's `run()` method when running the wsgi server. This required a
  new `ServerCheck` class to determine whether the wsgi server is
  selected when the `auto` option is used
- When using `gunicorn` along with the watchdog cache, package uplaods
  were not being picked up by the watcher. Updated the `add_package`
  and `remove_package` methods on the `CachingFileBackend` to bust the
  cache
2021-02-07 17:04:06 -06:00
Matthew Planchard d868005e1f
Docker improvements (#365)
* Docker improvements

This addresses much of what was brought up in #359. Specifically, it:

- Significantly improves testing for the Docker image, adding a
  `docker/test_docker.py` file using the regular pytest machinery to
  set up and run docker images for testing
- Hopefully addresses a variety of permissions issues, by being explicit
  about what access pypiserver needs and asking for it, only erroring
  if that access is not available
  - Requires RX permissions on `/data` (R to read files, X to list files
    and to be able to cd into the directory. This is important since
    `/data` is the `WORKDIR`)
  - Requires RWX permissions on `/data/packages`, so that we can list
    packages, write packages, and read packages.
  - When running in the default configuration (as root on Linux or
    as the pypiserver-named rootish user on Mac), with no volumes
    mounted, these requirements are all satisfied
  - Volume mounts still must be readable by the pypiserver user (UID
    9898) in order for the container to run. However, we now error early
    if this is not the case, and direct users to a useful issue.
  - If the container is run as a non-root, non-pypiserver user (e.g.
    because someone ran `docker run --user=<user_id>`, we try to run
    pypiserver as that user). Provided that user has access to the
    necessary directories, it should run fine.
- Fixes issues with running help and similar commands
- Updates the Docker image to use `PYPISERVER_PORT` for port
  specification, while still falling back to `PORT` for backwards
  compatibility
- Moves some docker-related things into a `/docker` directory
- Adds a `Makefile` for building a test fixture package sdist and wheel,
  so that test code can call `make mypkg` and not need to worry about it
  potentially building multiple times

The only issue #359 raises that's not addressed here is the one of
running pypiserver in the Docker container using some non-default server
for performance. I would like to do some benchmarking before deciding on
what to do there.
2021-02-06 11:28:15 -06:00
Matthew Planchard d0694d9e15
Switch to GH actions (#361)
* Switch to GH actions

Removes the travis config and adds a GH actions config. Resolves #360.

As part of this:

- only runs the README check once, instead of for each python version
- only runs mypy once, removing it from tox
- unifies the pypy and cpython tests in tox by separating dev and test
  requirements, and only installing the latter for running tests in tox

* Update README w/badge & link to GH actions tests
2020-11-15 20:08:58 -06:00
Matthew Planchard 0594c33e53
Backwards-compatible argparse config (not yet in use) (#339)
Adds an argparse config that, while adding subcommands (`pypi-server run` and `pypi-server update`), retains full commandline backwards compatibility with the existing config parsing logic.

There's a bit of hackery required to do this, so this also issues a warning if using the non-subcommand arguments, allowing us to potentially remove support for the old form in our next next major version bump (i.e. 3.0).

Also adds a `.pyproject.toml` with a black config, and a mypy config block to `setup.cfg`.

`mypy` is now called in `tox`, currently only for `config.py`, because nothing else typechecks successfully.

----

* WIP: argparse config

* Complete config

* Test all the config options

* Another test and a note re: being unused

* mypy config, call mypy in tox

* No mypy on pypy

* Fix tox config

* Add venv to black ignore

* fix tox config (again)

* Fix formatting, simplify error handling

* FMT: Run black on changed files
2020-10-08 19:37:39 -05:00
Matthew Planchard 972f1616dd
Use GitLab as CI Provider (#269)
* Add gitlab CI

* minmor updates to readme in /bin

* no autodeploy; less scary
2019-09-17 20:44:15 -05:00
Matthew Planchard 410498a059 test_server.py cleanup
Resolves #226

Cleaned up `test_server.py` a bit:

* Call `twine` via `Popen` instead of using their internal API, which
  should help us from having to fix twine tests as often
* Cleaned up fixtures
* Some PEP8 updates and general formatting
* Grouped test fixtures and functions all before the tests themselves
2018-11-09 18:44:41 -06:00
Matthew Planchard 4c92fafb4f Pin twine for tests to 1.11, add py37 to test suite 2018-11-09 16:58:45 -06:00
Hugo a8b7efc776 Drop support for EOL Python 3.3 2018-05-07 22:29:36 +03:00
Matthew Planchard 8639ad3d40 Provide Prerelease Testing for Twine
Resolves #203
Related to pypa/twine#314

This commit adds an ``sh -c`` call, whose argument is the value of the
environment variable ``PYPISERVER_SETUP_CMD``, or ``true`` if that
variable is not set. This was specifically added to enable the
``pre_twine`` environment, which is provided to automatically test
pre-releases of twine, both for our use (e.g. #203) and for the use of
the twine maintainers (pypa/twine#314).

The capacity to specify an arbitrary setup command via an environment
variable may also wind up being useful in other cases in the future.

In addition, the envlist is updated to include only Python versions we
actually support.

This commit also alphabetizes the ``dev.pip`` requirements and rmeoves
specific requirements for testing using Python 2.5 (which we do not test
against anymore).
2018-03-06 20:08:14 -06:00
Matthew Planchard e8f54aeba2 Pinned pytest requirement for Python 3.3 2017-11-29 18:59:05 -06:00
Matthew Planchard 1770f3cf93 Updated Tests
In addition to including tests from @jameshiebert with slight
updates, I have also resolved an issue with newer versions of twine,
which require an extra parameter in the calls to `upload` and
`register`.
2017-11-14 11:02:44 -06:00
Kostis Anagnostopoulos 6e930c5621 feat(build): add `/bin/bumpver.py` script to facilitate new releases 2017-10-31 21:03:17 +02:00
Youhei Sakurai b6503b02f6 Fix twine's version up to 1.7.4 to avoid failures in test_server.py 2016-09-23 14:08:08 +09:00
Matthew Planchard a05d5a103b Update Tests for New Twine
* Updated .travis.yml to fix PEP 440 warnings
* Fixed twine calls

We were getting test failures on multiple branches in
`test_server.py`. I first investigated a warning message
popping up in every test run:

```
PEP440Warning,
/home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages/pkg_resources/__init__.py:2510: PEP440Warning: 'setuptools (git-0.4.0)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
```

Moving the installation of setuptools, pip, sphinx, and tox
into the `install` key for Travis resolved that issue, but
`test_server.py` tests were still failing. It turns out that
Twine 1.7.0 added support for SSL cert specification and,
in the process, changed the call signature for the `upload`
and `register` internal methods.

This PR fixes the calls so that they align with Twine's new
function signature. Note that tests now fail on Twine <1.7.0,
so I have also updated the dev requirements file.
2016-07-17 14:35:58 -05:00
Matthew Planchard 3278e5c0e4 Added passlib version specification (#120) 2016-03-11 11:46:29 -06:00
Matthew Planchard 4a299ec40b Added python3.5 support to setup.py and tests for #108
- Added wheel to dev requirements
2016-01-20 23:30:22 +01:00
ankostis on tokoti 3676771719 FIX test_server FC!
+ Generate dummy-dists within tests to support running on every 
  platform/py-version.
  + delete pr-generated dummy-wheels.
+ Add forgotten test-packages `twinw`, `passlib`!
+ Update bugfix signing `twine` 1.6.1-->1.6.1.
2015-09-20 11:11:57 +02:00
ankostis on tokoti 4bb758da30 PIP test-server.
+ Rework test_server fictures with ports, pswds, and package-dirs.
+ Increase dep: pip>=7
2015-09-19 02:04:32 +02:00
Kostis Anagnostopoulos 699a73bf04 Provide `mock` library for py-3.2. 2015-09-18 18:57:58 +02:00
Kostis Anagnostopoulos c07dbd6b11 FIX Requirements.
+ Have `tox` read from requirements-file.
+ Add forgotten 'passlib' dep in `setup.py'!
2015-09-18 18:24:33 +02:00
Kostis Anagnostopoulos 01ebd96cc8 Add dev & exe pip-requirements files. 2015-09-17 20:23:26 +02:00