Skip to content

Commit 1f0d3c8

Browse files
authored
Merge pull request #20 from yusuf-jkhan1/feat/binary_install_simplification
Bundle azcopy and config template inside package; remove azpype-init/…
2 parents 0ca1436 + 3eba438 commit 1f0d3c8

File tree

21 files changed

+101
-175
lines changed

21 files changed

+101
-175
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,70 @@
1-
name: Build and Publish Universal Wheel
1+
name: Build and Publish
22

33
on:
44
push:
5+
tags:
6+
- 'v*' # Trigger on version tags
57
branches:
6-
- main
7-
- develop
8-
pull_request:
9-
types:
10-
- closed
8+
- main # Build on main for testing
9+
pull_request: # Build on PRs for testing
1110

1211
jobs:
13-
build_wheels:
14-
name: Build universal wheel
12+
build:
13+
name: Build wheel
1514
runs-on: ubuntu-latest
1615

1716
steps:
1817
- name: Checkout code
19-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
2019

2120
- name: Set up Python
22-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v5
2322
with:
24-
python-version: 3.8
23+
python-version: '3.11'
24+
25+
- name: Install build dependencies
26+
run: python -m pip install --upgrade pip build
2527

2628
- name: Build wheel
27-
run: |
28-
python -m pip install wheel # Ensure wheel is installed
29-
python setup.py bdist_wheel --universal
30-
mkdir -p wheelhouse
31-
mv dist/*.whl wheelhouse/
29+
run: python -m build --wheel
3230

3331
- name: Upload artifact
3432
uses: actions/upload-artifact@v4
3533
with:
36-
name: wheels
37-
path: ./wheelhouse/*.whl
34+
name: dist
35+
path: ./dist/*.whl
3836

39-
upload_wheels:
40-
needs: build_wheels
37+
publish:
38+
name: Publish to PyPI
39+
needs: build
4140
runs-on: ubuntu-latest
42-
if: github.event.pull_request.merged == true || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
41+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
42+
4343
steps:
4444
- name: Download wheels
4545
uses: actions/download-artifact@v4
4646
with:
47-
name: wheels
47+
name: dist
4848
path: dist/
4949

50-
- name: Set up Python 3.8
51-
uses: actions/setup-python@v2
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
5252
with:
53-
python-version: 3.8
53+
python-version: '3.11'
5454

5555
- name: Install twine
56-
run: python -m pip install twine
56+
run: python -m pip install --upgrade pip twine
57+
58+
- name: Publish to Test PyPI
59+
if: contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha')
60+
run: twine upload --skip-existing --repository testpypi dist/*.whl
61+
env:
62+
TWINE_USERNAME: __token__
63+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
5764

58-
- name: Publish wheels to PyPI
59-
run: |
60-
if [ "${{ github.ref }}" = "refs/heads/develop" ]; then
61-
twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*.whl
62-
else
63-
twine upload --skip-existing --repository-url https://upload.pypi.org/legacy/ dist/*.whl
64-
fi
65+
- name: Publish to PyPI
66+
if: ${{ !contains(github.ref, '-rc') && !contains(github.ref, '-beta') && !contains(github.ref, '-alpha') }}
67+
run: twine upload --skip-existing dist/*.whl
6568
env:
6669
TWINE_USERNAME: __token__
6770
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_AZPYPE }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
test_assets/
33
TODO.txt
44
.venv/
5+
*.venv/
56
nb_tests/
67
misc/
78
# Byte-compiled / optimized / DLL files

MANIFEST.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
include setup/assets/bin/azcopy_darwin_amd64_10.18.1/azcopy
2-
include setup/assets/bin/azcopy_linux_amd64_10.18.1/azcopy
3-
include setup/assets/bin/azcopy_linux_arm64_10.18.1/azcopy
4-
include setup/assets/bin/azcopy_windows_amd64_10.18.1/azcopy.exe
5-
include setup/assets/config_templates/copy_config.yaml
1+
include azpype/assets/bin/azcopy_darwin_amd64_10.18.1/azcopy
2+
include azpype/assets/bin/azcopy_linux_amd64_10.18.1/azcopy
3+
include azpype/assets/bin/azcopy_linux_arm64_10.18.1/azcopy
4+
include azpype/assets/bin/azcopy_windows_amd64_10.18.1/azcopy.exe
5+
include azpype/assets/config_templates/copy_config.yaml
66
include requirements.txt

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ Install via pip
2828
pip install azpype
2929
```
3030

31-
Then from the terminal run
32-
```
33-
azpype-init
34-
```
35-
This will install and setup a `~/.azpype` directory and download the appropriate azcopy binary and baseline config.
31+
No separate init step is required. The AzCopy binary and a baseline config template ship with the package.
32+
On first use, azpype will create `~/.azpype/copy_config.yaml` from the bundled template if it doesn't exist.
3633

3734
---
3835
## Usage
@@ -90,7 +87,7 @@ For shared access signature use the `sas_token` parameter in the `Copy()` comman
9087

9188
### Configuration
9289

93-
When pip installed a directory called `~/.azpype` will be created, underneath it there will be a configuration file called `copy_config.yaml`. These are default key-values that are options/arguments to the `Copy` command.
90+
When installed, azpype includes a configuration template. On first run, a `~/.azpype/copy_config.yaml` file will be created if missing. These are default key-values that are options/arguments to the `Copy` command.
9491
For example the yaml could have values like this:
9592
```yaml
9693
# Overwrite the conflicting files and blobs at the destination if this flag is set to true.

setup/assets/bin/azcopy_darwin_amd64_10.18.1/NOTICE.txt renamed to azpype/assets/bin/azcopy_darwin_amd64_10.18.1/NOTICE.txt

File renamed without changes.
File renamed without changes.

setup/assets/bin/azcopy_linux_amd64_10.18.1/NOTICE.txt renamed to azpype/assets/bin/azcopy_linux_amd64_10.18.1/NOTICE.txt

File renamed without changes.
File renamed without changes.

setup/assets/bin/azcopy_linux_arm64_10.18.1/NOTICE.txt renamed to azpype/assets/bin/azcopy_linux_arm64_10.18.1/NOTICE.txt

File renamed without changes.

0 commit comments

Comments
 (0)