Skip to content

Commit eef7d0c

Browse files
committed
rewrite
0 parents  commit eef7d0c

File tree

283 files changed

+34868
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+34868
-0
lines changed

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# TODO: move this to pyproject.toml when supported, see https://github.com/PyCQA/flake8/issues/234
2+
3+
[flake8]
4+
select = B,C,E,F,W,B001,B003,B006,B007,B301,B305,B306,B902,Q000,Q001,Q002,Q003
5+
ignore = E203,E722,W503
6+
exclude = .tox,build,backend/hatchling/utils/compat.py
7+
max-line-length = 120

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github:
2+
- ofek
3+
custom:
4+
- https://ofek.dev/donate/

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Description
2+
<!--- A few words to describe your changes -->
3+
4+
5+
6+
## Checklist
7+
<!--- We appreciate your help and please add yourself to the AUTHORS file. -->

.github/workflows/build-hatch.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: build hatch
2+
3+
on:
4+
push:
5+
tags:
6+
- hatch-v*
7+
8+
concurrency:
9+
group: build-hatch-${{ github.head_ref }}
10+
11+
jobs:
12+
build:
13+
name: Build wheels and source distribution
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Install build dependencies
20+
run: python -m pip install --upgrade build
21+
22+
- name: Build source distribution
23+
run: python -m build
24+
25+
- uses: actions/upload-artifact@v2
26+
with:
27+
name: artifacts
28+
path: dist/*
29+
if-no-files-found: error
30+
31+
publish:
32+
name: Publish release
33+
needs:
34+
- build
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- uses: actions/download-artifact@v2
39+
with:
40+
name: artifacts
41+
path: dist
42+
43+
- name: Push build artifacts to PyPI
44+
uses: pypa/gh-action-pypi-publish@v1.4.2
45+
with:
46+
skip_existing: true
47+
user: __token__
48+
password: ${{ secrets.PYPI_API_TOKEN_HATCH }}

.github/workflows/build-hatchling.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: build hatchling
2+
3+
on:
4+
push:
5+
tags:
6+
- hatchling-v*
7+
8+
concurrency:
9+
group: build-hatchling-${{ github.head_ref }}
10+
11+
jobs:
12+
build:
13+
name: Build wheels and source distribution
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Install build dependencies
20+
run: python -m pip install --upgrade build
21+
22+
- name: Build source distribution
23+
run: python -m build backend
24+
25+
- uses: actions/upload-artifact@v2
26+
with:
27+
name: artifacts
28+
path: backend/dist/*
29+
if-no-files-found: error
30+
31+
publish:
32+
name: Publish release
33+
needs:
34+
- build
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- uses: actions/download-artifact@v2
39+
with:
40+
name: artifacts
41+
path: dist
42+
43+
- name: Push build artifacts to PyPI
44+
uses: pypa/gh-action-pypi-publish@v1.4.2
45+
with:
46+
skip_existing: true
47+
user: __token__
48+
password: ${{ secrets.PYPI_API_TOKEN_HATCHLING }}

.github/workflows/docs-dev.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: dev docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: docs-deploy
13+
14+
env:
15+
FORCE_COLOR: "1"
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
# Fetch all history for applying timestamps to every page
25+
fetch-depth: 0
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: '3.9'
31+
32+
- name: Validate history
33+
run: python scripts/validate_history.py
34+
35+
- name: Ensure latest pip
36+
run: python -m pip install --upgrade pip
37+
38+
- name: Install ourself
39+
run: pip install -e .
40+
41+
- name: Configure Git for GitHub Actions bot
42+
run: |
43+
git config --local user.name 'github-actions[bot]'
44+
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
45+
46+
- name: Build documentation
47+
run: hatch run docs:ci-build dev
48+
49+
- name: Create archive
50+
run: git archive -o site.zip gh-pages
51+
52+
- uses: actions/upload-artifact@v2
53+
with:
54+
name: documentation
55+
path: site.zip
56+
57+
publish:
58+
runs-on: ubuntu-latest
59+
60+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
61+
needs:
62+
- build
63+
64+
steps:
65+
- uses: actions/download-artifact@v2
66+
with:
67+
name: documentation
68+
69+
- name: Unpack archive
70+
run: python -m zipfile -e site.zip site
71+
72+
- uses: peaceiris/actions-gh-pages@v3
73+
with:
74+
github_token: ${{ secrets.GITHUB_TOKEN }}
75+
publish_dir: site
76+
commit_message: ${{ github.event.head_commit.message }}
77+
# Write .nojekyll at the root, see:
78+
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
79+
enable_jekyll: false
80+
# Only deploy if there were changes
81+
allow_empty_commit: false

.github/workflows/docs-release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: release docs
2+
3+
on:
4+
create:
5+
tags:
6+
- hatch-v*
7+
- hatchling-v*
8+
9+
concurrency:
10+
group: docs-deploy
11+
12+
env:
13+
FORCE_COLOR: "1"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
# Fetch all history for applying timestamps to every page
23+
fetch-depth: 0
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: '3.9'
29+
30+
- name: Validate history
31+
run: python scripts/validate_history.py
32+
33+
- name: Ensure latest pip
34+
run: python -m pip install --upgrade pip
35+
36+
- name: Install ourself
37+
run: pip install -e .
38+
39+
- name: Display full version
40+
run: hatch version
41+
42+
- name: Set the version of docs to publish
43+
run: python scripts/set_release_version.py
44+
45+
- name: Configure Git for GitHub Actions bot
46+
run: |
47+
git config --local user.name 'github-actions[bot]'
48+
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
49+
50+
- name: Deploy documentation
51+
run: hatch run docs:ci-build $HATCH_DOCS_VERSION latest
52+
53+
- name: Create archive
54+
run: git archive -o site.zip gh-pages
55+
56+
- uses: actions/upload-artifact@v2
57+
with:
58+
name: documentation
59+
path: site.zip
60+
61+
publish:
62+
runs-on: ubuntu-latest
63+
needs:
64+
- build
65+
66+
steps:
67+
- uses: actions/download-artifact@v2
68+
with:
69+
name: documentation
70+
71+
- name: Unpack archive
72+
run: python -m zipfile -e site.zip site
73+
74+
- uses: peaceiris/actions-gh-pages@v3
75+
with:
76+
github_token: ${{ secrets.GITHUB_TOKEN }}
77+
publish_dir: site
78+
commit_message: ${{ github.event.head_commit.message }}
79+
# Write .nojekyll at the root, see:
80+
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
81+
enable_jekyll: false
82+
# Only deploy if there were changes
83+
allow_empty_commit: false

.github/workflows/test.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: test-${{ github.head_ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
PYTHONUNBUFFERED: "1"
17+
FORCE_COLOR: "1"
18+
19+
jobs:
20+
run:
21+
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-latest, windows-latest, macos-latest]
27+
python-version: ['3.8', '3.9', '3.10']
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Ensure latest pip
38+
run: python -m pip install --upgrade pip
39+
40+
- name: Install ourself
41+
run: pip install -e .
42+
43+
- if: matrix.python-version == '3.9' && runner.os == 'Linux'
44+
name: Lint
45+
run: hatch run lint:all
46+
47+
- name: Run tests
48+
env:
49+
HATCH_CI_PUBLISHER_TOKEN: ${{ secrets.HATCH_CI_PUBLISHER_TOKEN }}
50+
run: hatch run full
51+
52+
downstream:
53+
name: Downstream builds with Python ${{ matrix.python-version }}
54+
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
python-version: ['2.7', '3.8']
59+
60+
steps:
61+
- uses: actions/checkout@v2
62+
63+
- name: Set up Python ${{ matrix.python-version }}
64+
uses: actions/setup-python@v2
65+
with:
66+
python-version: ${{ matrix.python-version }}
67+
68+
- name: Install tools
69+
run: pip install --upgrade -r tests/backend/downstream/requirements.txt
70+
71+
- name: Build downstream projects
72+
run: python tests/backend/downstream/integrate.py
73+
74+
response-time:
75+
name: CLI responsiveness with latest Python
76+
runs-on: ubuntu-latest
77+
78+
env:
79+
PYTHON_VERSION: '3.10'
80+
HYPERFINE_VERSION: '1.12.0'
81+
82+
steps:
83+
- uses: actions/checkout@v2
84+
85+
- name: Set up Python ${{ env.PYTHON_VERSION }}
86+
uses: actions/setup-python@v2
87+
with:
88+
python-version: ${{ env.PYTHON_VERSION }}
89+
90+
- name: Install hyperfine
91+
run: |
92+
wget https://github.com/sharkdp/hyperfine/releases/download/v${HYPERFINE_VERSION}/hyperfine_${HYPERFINE_VERSION}_amd64.deb
93+
sudo dpkg -i hyperfine_${HYPERFINE_VERSION}_amd64.deb
94+
95+
- name: Install other tools
96+
run: pip install --upgrade flit poetry pipenv
97+
98+
- name: Install ourself
99+
run: pip install .
100+
101+
- name: Benchmark
102+
run: |
103+
hyperfine -m 100 --warmup 10 -i pipenv
104+
hyperfine -m 100 --warmup 10 poetry
105+
hyperfine -m 100 --warmup 10 -i flit
106+
hyperfine -m 100 --warmup 10 hatch

0 commit comments

Comments
 (0)