1
0
mirror of https://github.com/pypiserver/pypiserver synced 2024-12-20 13:55:49 +01:00

chore: prepare for renaming to main (#611)

* chore: adjust gha to use `main`

* chore: adjust `ci_helper`

* chore: adjust README

* chore: add small todos
This commit is contained in:
Mitja O 2024-10-06 22:37:07 +02:00 committed by GitHub
parent 0430375272
commit f3d6dde371
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 20 deletions

@ -6,7 +6,8 @@ on:
# This will run when any branch or tag is pushed
push:
branches:
- "master"
- "master" # TODO(tech-debt): remove after switching the default branch
- "main"
tags:
- "v**"
# Allowing to run on fork and other pull requests
@ -129,7 +130,7 @@ jobs:
needs:
- "tests"
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:

@ -8,7 +8,7 @@ name: release_candidate
# - [x] update CHANGES.rst (+ rc-title, + date)
# - [x] create changes commit
# - [x] push to GH
# - [x] open a PR to `master`
# - [x] open a PR to `main`
on:
schedule:
@ -53,12 +53,15 @@ jobs:
- id: propose-rc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: github-actions[bot]
GITHUB_EMAIL: github-actions[bot]@users.noreply.github.com
BASE_BRANCH: main
run: |
CHANGES_FILE=${{ env.CHANGES_FILE }}
PR_BODY_FILE=${{ env.PR_BODY_FILE }}
RC_DATE=${{ steps.get-rc-date.outputs.RC_DATE }}
git config user.name github-actions
git config user.email github-actions@github.com
git config user.name ${{ env.GITHUB_USERNAME }}
git config user.email ${{ env.GITHUB_EMAIL }}
git checkout -b auto-release-candidate-${RC_DATE}
git push -u origin auto-release-candidate-${RC_DATE}
@ -73,5 +76,5 @@ jobs:
gh pr create --title "chore(auto-release-candidate-${RC_DATE})" \
--body-file ${PR_BODY_FILE} \
--base master \
--base ${{ env.BASE_BRANCH }} \
--draft

@ -19,7 +19,8 @@ on:
jobs:
new-tag:
if: ${{ github.ref_name == 'master' }}
# TODO(tech-debt): cleanup after switching the default branch
if: ${{ github.ref_name == 'master' || github.ref_name == 'main' }}
runs-on: ubuntu-latest
env:
CHANGE_FILE: CHANGES.rst

@ -5,7 +5,7 @@
[![pypi badge](https://img.shields.io/pypi/v/pypiserver.svg)](https://shields.io/)
[![ci workflow](https://github.com/pypiserver/pypiserver/actions/workflows/ci.yml/badge.svg)](https://github.com/pypiserver/pypiserver/actions/workflows/ci.yml)
[![Generic badge](https://img.shields.io/badge/python-3.6%7C3.7%7C3.8+-blue.svg)](https://pypi.org/project/pypiserver/)
[![Generic badge](https://img.shields.io/badge/license-MIT%7Czlib/libpng-blue.svg)](https://raw.githubusercontent.com/pypiserver/pypiserver/master/LICENSE.txt)
[![Generic badge](https://img.shields.io/badge/license-MIT%7Czlib/libpng-blue.svg)](https://raw.githubusercontent.com/pypiserver/pypiserver/main/LICENSE.txt)
| name | description |
| :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@ -497,9 +497,9 @@ To avoid storing you passwords on disk, in clear text, you may either:
## Using the Docker Image
Starting with version 1.2.5, official Docker images will be built for each
push to master, each dev, alpha, or beta release, and each final release.
push to `main`, each dev, alpha, or beta release, and each final release.
The most recent full release will always be available under the tag **latest**,
and the current master branch will always be available under the tag
and the current `main` branch will always be available under the tag
**unstable**.
You can always check to see what tags are currently available at our
@ -540,7 +540,8 @@ To authenticate against a local **.htpasswd** file::
```
You can also specify **pypiserver** to run as a Docker service using a
composefile. An example composefile is [provided](https://github.com/pypiserver/pypiserver/blob/master/docker-compose.yml)
composefile. An example composefile is provided as
[`docker-compose.yaml`](./docker-compose.yml)
## Alternative Installation Methods
@ -1020,7 +1021,7 @@ server {
It is also possible to use [Traefik](https://docs.traefik.io/) to put pypiserver
behind HTTPS on port 443, with automatic HTTP redirection using Docker Compose.
Please see the provided
[docker-compose.yml](https://github.com/pypiserver/pypiserver/blob/master/docker-compose.yml)
[docker-compose.yml](./docker-compose.yml)
example for more information.
### Utilizing the API
@ -1030,12 +1031,12 @@ not supported by *bottle* out-of-the-box, you needed to launch **pypiserver**
via its API.
- The main entry-point for configuring **pypiserver** is the
[pypiserver:app()](https://github.com/pypiserver/pypiserver/blob/master/pypiserver/__init__.py#L116)
[pypiserver:app()](./pypiserver/__init__.py#L116)
function. This function returns the internal WSGI-app that you my then
send to any WSGI-server you like.
- To get all **pypiserver:app()** keywords and their explanations, read the
function [pypiserver:default_config()](https://github.com/pypiserver/pypiserver/blob/master/pypiserver/__init__.py#L35)
function [pypiserver:default_config()](./pypiserver/__init__.py#L35)
- Finally, to fire-up a WSGI-server with the configured app, invoke
the **bottle:run(app, host, port, server)** function.
@ -1171,9 +1172,9 @@ The following limitations are known:
discussion)
- It does not handle misspelled packages as *pypi-repo* does,
therefore it is suggested to use it with **--extra-index-url** instead
of **--index-url** (see [#38](https://github.com/pypiserver/pypiserver/issues/38%3E)).
of **--index-url** (see [#38](https://github.com/pypiserver/pypiserver/issues/38)).
Please use Github's [bugtracker](https://github.com/pypiserver/pypiserver/issues%3E)
Please use Github's [bugtracker](https://github.com/pypiserver/pypiserver/issues)
for other bugs you find.
## Similar Projects

@ -10,6 +10,7 @@ from argparse import ArgumentParser, Namespace
RELEASE_RE = re.compile(r"v[0-9]+\.[0-9]+\.[0-9]+(\.post[0-9]+)?")
PRE_RELEASE_RE = re.compile(r"v[0-9]+\.[0-9]+\.[0-9]+(a|b|c|\.?dev)[0-9]+")
BASE_BRANCH = "main"
def parse_args() -> Namespace:
@ -19,8 +20,8 @@ def parse_args() -> Namespace:
"ref",
help=(
"The github ref for which CI is running. This may be a full ref "
"like refs/tags/v1.2.3 or refs/heads/master, or just a tag/branch "
"name like v1.2.3 or master."
f"like refs/tags/v1.2.3 or refs/heads/{BASE_BRANCH}, or just a tag/branch "
"name like v1.2.3 or main."
),
)
parser.add_argument(
@ -43,8 +44,8 @@ def strip_ref_to_name(ref: str) -> str:
def name_to_array(name: str) -> t.Tuple[str, ...]:
"""Convert a ref name to an array of tags to build."""
tags: t.Dict[str, t.Callable[[str], bool]] = {
# unstable for any master build
"unstable": lambda i: i == "master",
# unstable for the regular, base, build
"unstable": lambda i: i == BASE_BRANCH,
# latest goes for full releases
"latest": lambda i: RELEASE_RE.fullmatch(i) is not None,
# the tag itself for any release or pre-release tag