Skip to content

Commit 4fbbf7f

Browse files
authored
Merge pull request #90 from adorton-adobe/poetry
Switch from setup.py to Poetry
2 parents 5b763bd + 07fd486 commit 4fbbf7f

23 files changed

+580
-116
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ jobs:
2323
uses: actions/setup-python@v2
2424
with:
2525
python-version: ${{ matrix.python-version }}
26+
- name: Set up Poetry
27+
uses: abatilo/[email protected]
28+
with:
29+
poetry-version: 1.1.5
2630
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip setuptools wheel
29-
pip install -e .
30-
pip install -e .[test]
31-
pip install -e .[setup]
32-
- name: Test with pytest
33-
run: |
34-
pytest
31+
run: poetry install
32+
- name: Run tests
33+
run: poetry run pytest

.github/workflows/publish.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ jobs:
1414
uses: actions/setup-python@v2
1515
with:
1616
python-version: '3.x'
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install setuptools wheel twine
17+
- name: Set up Poetry
18+
uses: abatilo/[email protected]
19+
with:
20+
poetry-version: 1.1.5
2121
- name: Build
22-
run: python setup.py sdist bdist_wheel
22+
run: |
23+
poetry install
24+
poetry build
2325
- name: Create release
2426
uses: actions/create-release@v1
2527
env:
@@ -40,6 +42,5 @@ jobs:
4042
release-tag: ${{ steps.get_version.outputs.version }}
4143
- name: Publish to PyPI
4244
env:
43-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
44-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
45-
run: twine upload dist/*
45+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
46+
run: poetry publish

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016-2017 Adobe Inc. All rights reserved.
3+
Copyright (c) 2016-2021 Adobe Inc. All rights reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,60 @@ of the OSI-approved MIT license. Copyright (c) 2016-2021 Adobe Inc.
1212

1313
# Installation
1414

15-
You can get this package from PyPI: `pip install umapi-client`.
16-
Or you can download the posted package from GitHub and use pip
17-
to install from the download.
15+
`umapi-client.py` is published to the Python Packaging Index.
16+
17+
https://pypi.org/project/umapi-client/
18+
19+
It can be installed with pip:
20+
21+
```
22+
$ pip install umapi-client
23+
```
24+
25+
Or a dependency manager such as Poetry:
26+
27+
```
28+
$ poetry add umapi-client
29+
```
1830

1931
# Building
2032

21-
1. Clone this repository or download one of the posted releases.
22-
2. From the command line, change to the `umapi-client.py` directory.
23-
3. To install, run the command `python setup.py install`.
24-
[**NOTE**: To avoid needing admin/root privileges for the installation
25-
of needed dependencies,
26-
it is recommended that you use `virtualenv` (or equivalent)
27-
to make a virtual python environment. See the
28-
[virtualenvwrapper documentation](http://virtualenvwrapper.readthedocs.io/en/latest/index.html)
29-
for more information.
33+
[Poetry](https://python-poetry.org/) is required to build the package. Follow the instructions documented on
34+
Poetry's website to install it on your system.
35+
36+
1. Clone this repository
37+
```
38+
$ git clone https://github.com/adobe-apiplatform/umapi-client.py
39+
$ cd umapi-client.py
40+
```
41+
42+
2. Install dependencies to virtual environment.
43+
```
44+
$ poetry install
45+
```
46+
47+
3. The `build` command will create a source package (`.tar.gz`) and a wheel file (`.whl`) in the `dist` directory.
48+
```
49+
$ poetry build
50+
$ ls dist
51+
umapi-client-2.17.1.tar.gz umapi_client-2.17.1-py3-none-any.whl
52+
```
53+
3054
4. Some of the packages required by this module use encryption, and so may
31-
require you to do local builds of modules that use SSL. Typically, this
32-
will require you to have a python installed that supports compiling
33-
extensions.
34-
5. To run tests, use the command `python setup.py test`.
55+
require you to do local builds of modules that use SSL. Typically, this
56+
will require you to have a python installed that supports compiling
57+
extensions.
58+
59+
5. Run tests with `pytest`.
60+
```
61+
$ poetry run pytest
62+
```
3563

3664
# Usage
3765

3866
Usage documentation, as well as information about how to get client
39-
credentials for use of the UMAPI, can be found on the
40-
[umapi-client wiki](https://adobe-apiplatform.github.io/umapi-client.py/),
67+
credentials for use of the UMAPI, can be found in the
68+
[user guide](https://adobe-apiplatform.github.io/umapi-client.py/),
4169
whose sources are in the `docs` directory of this repository.
4270

4371
# License

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ which provides Adobe Enterprise customers the ability to manage their users. Th
88
client makes it easy to access the UMAPI from a local Python application.
99

1010
This client is open source, maintained by Adobe, and distributed under the terms
11-
of the OSI-approved MIT license. Copyright (c) 2016-2017 Adobe Inc.
11+
of the OSI-approved MIT license. Copyright (c) 2016-2021 Adobe Inc.
1212

1313
# Installation
1414

0 commit comments

Comments
 (0)