Skip to content

Commit

Permalink
Merge branch 'master' into pyup-update-idna-3.0-to-3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperlees authored Jan 5, 2021
2 parents 5a1726b + 1fd87a7 commit 0c25fa4
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.8, 3.9]
os: [macOS-latest, ubuntu-latest, windows-latest]

steps:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
- name: Set up Python
uses: actions/setup-python@v2.2.1
with:
python-version: 3.7

- name: Install latest pip, setuptools + tox
run: |
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ env:
matrix:
fast_finish: true
include:
- python: 3.8
- python: 3.9
env: TOXENV=doc_build
- python: 3.8
- python: 3.9
env: TOXENV=lint
- python: 3.8
- python: 3.9
env: TOXENV=py3
- python: nightly
env: TOXENV=INTEGRATION
Expand Down
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 5.0.0 (2021-X-X)

## New Features

- bandersnatch is now a >= 3.8 Python project

## Bug Fixes

- No bugs yet - Software is super perfect! 😂

# 4.4.0 (2020-12-31)

## New Features
Expand Down
94 changes: 0 additions & 94 deletions DEVELOPMENT.md

This file was deleted.

24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ this project.
The following instructions will place the bandersnatch executable in a
virtualenv under `bandersnatch/bin/bandersnatch`.

- bandersnatch **requires** `>= Python 3.6.1`
- bandersnatch **requires** `>= Python 3.8.0`

## Docker

Expand All @@ -54,7 +54,7 @@ docker run pypa/bandersnatch bandersnatch --help
This installs the latest stable, released version.

```shell
python3.6 -m venv bandersnatch
python3 -m venv bandersnatch
bandersnatch/bin/pip install bandersnatch
bandersnatch/bin/bandersnatch --help
```
Expand Down Expand Up @@ -89,28 +89,29 @@ For nginx it should look something like this:
}
```

* Note that it is a good idea to have your webserver publish the HTML index
- Note that it is a good idea to have your webserver publish the HTML index
files correctly with UTF-8 as the charset. The index pages will work without
it but if humans look at the pages the characters will end up looking funny.

* Make sure that the webserver uses UTF-8 to look up unicode path names. nginx
- Make sure that the webserver uses UTF-8 to look up unicode path names. nginx
gets this right by default - not sure about others.


### Cron jobs

You need to set up one cron job to run the mirror itself.

Here's a sample that you could place in `/etc/cron.d/bandersnatch`:

```
```cron
LC_ALL=en_US.utf8
*/2 * * * * root bandersnatch mirror |& logger -t bandersnatch[mirror]
```

This assumes that you have a ``logger`` utility installed that will convert the
output of the commands to syslog entries.

[SystemD Timers](https://www.freedesktop.org/software/systemd/man/systemd.timer.html)
are also another alternative in today's modern world.

### Maintenance

Expand All @@ -120,14 +121,14 @@ errors.

If you want to force bandersnatch to check everything against the master PyPI:

* run `bandersnatch mirror --force-check` to move status files if they exist in your mirror directory in order get a full sync.
- run `bandersnatch mirror --force-check` to move status files if they exist in your mirror directory in order get a full sync.

Be aware that full syncs likely take hours depending on PyPI's performance and your network latency and bandwidth.

#### Other Commands

* `bandersnatch delete --help` - Allows you to specify package(s) to be removed from your mirror (*dangerous*)
* `bandersnatch verify --help` - Crawls your repo and fixes any missed files + deletes any unowned files found (*dangerous*)
- `bandersnatch delete --help` - Allows you to specify package(s) to be removed from your mirror (*dangerous*)
- `bandersnatch verify --help` - Crawls your repo and fixes any missed files + deletes any unowned files found (*dangerous*)

### Operational notes

Expand All @@ -151,8 +152,10 @@ The PyPI has a quite extensive list of packages that we need to maintain in a
flat directory. Filesystems with small limits on the number of sub-directories
per directory can run into a problem like this:

```console
2013-07-09 16:11:33,331 ERROR: Error syncing package: zweb@802449
OSError: [Errno 31] Too many links: '../pypi/web/simple/zweb'
```

Specifically we recommend to avoid using ext3. Ext4 and newer does not have the
limitation of 32k sub-directories.
Expand All @@ -167,7 +170,9 @@ other purposes.
An example of an unsupported API is [PyPI's XML-RPC interface](https://warehouse.readthedocs.io/api-reference/xml-rpc/), which is used when running `pip search`.

### Bandersnatch Mission

The bandersnatch project strives to:

- Mirror all static objects of the Python Package Index (https://pypi.org/)
- bandersnatch's main goal is to support the main global index to local syncing **only**
- This will allow organizations to have lower latency access to PyPI and
Expand All @@ -179,6 +184,7 @@ The bandersnatch project strives to:

If you have questions or comments, please submit a bug report to
https://github.com/pypa/bandersnatch/issues/new

- IRC: #bandersnatch on *Freenode* (You can use [webchat](https://webchat.freenode.net/?channels=%23bandersnatch) if you don't have an IRC client)

### Code of Conduct
Expand Down
13 changes: 0 additions & 13 deletions bootstrap.sh

This file was deleted.

48 changes: 36 additions & 12 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Contributing

So you want to help out? **Awesome**. Go you!

## Code of Conduct

Everyone interacting in the bandersnatch project's codebases, issue trackers,
chat rooms, and mailing lists is expected to follow the
[PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md).
Expand All @@ -11,23 +13,34 @@ chat rooms, and mailing lists is expected to follow the
Bandersnatch is developed using the [GitHub Flow](https://guides.github.com/introduction/flow/)

### Pre Install

Please make sure you system has the following:

- Python 3.6.1 or greater
- Python 3.8.0 or greater
- git client

### Checkout `bandersnatch`

Lets now cd to where we want the code and clone the repo:

- `cd somewhere`
- `git clone git@github.com:pypa/bandersnatch.git`

### Development venv

One way to develop and install all the dependencies of bandersnatch is to use a venv.

- First create one and upgrade `pip`

```
python3.6 -m venv /path/to/venv
```console
python3 -m venv /path/to/venv
/path/to/venv/bin/pip install --upgrade pip
```

For example:

```console
$ python3.6 -m venv bandersnatchvenv
$ python3 -m venv bandersnatchvenv
$ bandersnatchvenv/bin/pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Expand All @@ -45,6 +58,7 @@ Successfully installed pip-10.0.1
```

For example:

```console
$ bandersnatchvenv/bin/pip install -r requirements.txt -r test-requirements.txt
Collecting six==1.10.0 (from -r requirements.txt (line 2))
Expand Down Expand Up @@ -118,6 +132,12 @@ Installing collected packages: six, pyparsing, python-dateutil, packaging, reque
Successfully installed apipkg-1.4 attrs-18.1.0 bandersnatch-2.1.3 coverage-4.5.1 execnet-1.5.0 flake8-3.5.0 mccabe-0.6.1 more-itertools-4.1.0 packaging-16.8 pep8-1.7.1 pluggy-0.6.0 py-1.5.3 pycodestyle-2.3.1 pyflakes-1.6.0 pyparsing-2.1.10 pytest-3.5.1 pytest-cache-1.0 pytest-codecheckers-0.2 pytest-cov-2.5.1 pytest-timeout-1.2.1 python-dateutil-2.6.0 requests-2.12.4 six-1.10.0 tox-3.0.0 virtualenv-15.2.0 xmlrpc2-0.3.1
```

- Finally install bandersnatch in editable mode:

```console
/path/to/venv/bin/pip install -e .
```

## Running Bandersnatch

You will need to customize `src/bandersnatch/default.conf` and run via the following:
Expand All @@ -134,13 +154,14 @@ cd bandersnatch

We use tox to run tests. `tox.ini` has the options needed, so running tests is very easy.

```
```console
cd bandersnatch
/path/to/venv/bin/tox [-vv]
```

For example:
``` console
Example output:

```console
$ tox
GLOB sdist-make: /Users/dhubbard/PycharmProjects/bandersnatch/setup.py
py36 create: /Users/dhubbard/PycharmProjects/bandersnatch/.tox/py36
Expand Down Expand Up @@ -182,13 +203,16 @@ ________________________________________________________________________________
congratulations :)
```


You want to see:
```
py36: commands succeeded

```console
py3: commands succeeded
congratulations :)
```


## Making a release
*To be completed - @cooper has never used zc.buildout*

Please rely on GitHub actions to cut a release.

To do so, make a [GitHub Release](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/managing-releases-in-a-repository)
and GitHub Actions will package and upload to PyPI.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ attrs==20.3.0
chardet==3.0.4 # pyup: ignore
filelock==3.0.12
idna==3.1
importlib_resources==4.1.1; python_version < '3.7'
lxml==4.6.2
multidict==5.1.0
packaging==20.8
Expand Down
2 changes: 1 addition & 1 deletion requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python-dateutil==2.8.1
packaging==20.8
requests==2.25.1
six==1.15.0
sphinx==3.4.1
sphinx==3.4.2
recommonmark==0.7.1
xmlrpc2==0.3.1

Expand Down
Loading

0 comments on commit 0c25fa4

Please sign in to comment.