Skip to content

Commit 2300690

Browse files
committed
test deployment
1 parent 99030a1 commit 2300690

13 files changed

+57
-17
lines changed
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Python Package (Test)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.12'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
pip install -r requirements.txt
26+
27+
- name: Run tests
28+
run: |
29+
pip install pytest
30+
pytest
31+
32+
- name: Build package
33+
run: |
34+
python setup.py sdist bdist_wheel
35+
36+
- name: Publish package to PyPI
37+
env:
38+
TWINE_USERNAME: __token__
39+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
40+
run: |
41+
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ pip install noscrape
2828
```
2929

3030
## Usage
31+
3132
```python
32-
import noscrape
3333

34-
n = noscrape.Noscrape("example/example.ttf")
34+
from noscrape import Noscrape
35+
36+
n = Noscrape("example/example.ttf")
3537

3638
text = n.obfuscate("test")
3739

3840
b64_font = n.render()
3941
```
4042

43+
## Putting it together
44+

noscrape/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .noscrape import Noscrape
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

noscrape.py noscrape/noscrape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import random
33
import subprocess
44

5-
from load_noscrape_lib import load_noscrape_lib
5+
from noscrape.load_noscrape_lib import load_noscrape_lib
66

77

88
class Noscrape:

requirements.txt

Whitespace-only changes.

setup.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,21 @@
55

66
setup(
77
name="noscrape", # Replace with your own package name
8-
version="1.0.0", # Initial release version
8+
version="1.0.3", # Initial release version
99
author="Bernhard Schönberger",
1010
author_email="[email protected]",
1111
description="A package to obfuscate text using Unicode Private Use Area characters",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",
1414
url="https://github.com/noscrape/noscrape-python", # Replace with the URL of your project
1515
packages=find_packages(), # Automatically find and include all packages in the project
16+
package_data={
17+
'noscrape': ['bin/*'],
18+
},
1619
classifiers=[
1720
"Programming Language :: Python :: 3",
1821
"Operating System :: OS Independent",
1922
],
20-
python_requires='>=3.6', # Specify the Python versions compatible with your package
21-
install_requires=[
22-
# List your package dependencies here
23-
# e.g., 'requests', 'numpy',
24-
],
25-
entry_points={
26-
'console_scripts': [
27-
'noscrape=noscrape.__main__:main', # Replace with the entry point for your package
28-
],
29-
},
30-
include_package_data=True, # Include non-Python files specified in MANIFEST.in
23+
python_requires='>=3.6',
24+
include_package_data=True,
3125
)

noscrape_test.py tests/noscrape_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import unittest
22

3-
import noscrape
3+
from noscrape import Noscrape
44

55

66
class TestNoscrape(unittest.TestCase):
77
def test_noscrape(self):
8-
n = noscrape.Noscrape("example/example.ttf")
8+
n = Noscrape("../example/example.ttf")
99

1010
xy = n.obfuscate("test")
1111
self.assertNotEquals(xy, "test")

0 commit comments

Comments
 (0)