Skip to content

Commit db61f1a

Browse files
authored
Revert "Revert "ci: added auto publishing to PyPi (#53)"" (#58)
1 parent 237802a commit db61f1a

File tree

8 files changed

+49
-24
lines changed

8 files changed

+49
-24
lines changed

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Upload Python Package
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: microsoft/playwright-github-action@v1
11+
- name: Set up Node.js
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 12.x
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.8
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r local-requirements.txt
23+
pip install .
24+
- name: Build driver
25+
run: python build_driver.py
26+
- name: Build package
27+
run: python build_package.py
28+
- name: Publish package
29+
env:
30+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
31+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
32+
run: twine upload dist/*

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ env/
1111
htmlcov/
1212
.coverage
1313
.DS_Store
14-
.vscode/
14+
.vscode/
15+
.eggs
16+
_repo_version.py

docs/development.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Build driver:
44

55
```sh
6+
pip install -e .
67
python ./build_driver.py
78
```
89

driver/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

local-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ wheel==0.34.2
1010
black==19.10b0
1111
pre-commit==2.6.0
1212
flake8==3.8.3
13+
twine==3.2.0

playwright/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from playwright._repo_version import version as __version__ # noqa:F401
1516
from playwright.main import playwright_object
1617
import playwright.helper as helper
1718

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@
1919

2020
setuptools.setup(
2121
name="playwright",
22-
version="0.0.3",
2322
author="Microsoft Corporation",
2423
author_email="",
2524
description="A high-level API to automate web browsers",
2625
long_description=long_description,
2726
long_description_content_type="text/markdown",
2827
url="https://github.com/Microsoft/playwright-python",
29-
packages=setuptools.find_packages(),
28+
packages=["playwright"],
3029
include_package_data=True,
31-
install_requires=["pyee", "typing-extensions",],
30+
install_requires=["pyee", "typing-extensions"],
3231
classifiers=[
3332
"Topic :: Software Development :: Testing",
3433
"Topic :: Internet :: WWW/HTTP :: Browsers",
@@ -40,4 +39,10 @@
4039
"Operating System :: OS Independent",
4140
],
4241
python_requires=">=3.7",
42+
use_scm_version={
43+
"version_scheme": "post-release",
44+
"write_to": "playwright/_repo_version.py",
45+
"write_to_template": 'version = "{version}"\n',
46+
},
47+
setup_requires=["setuptools_scm"],
4348
)

upload_package.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)