Skip to content

Commit

Permalink
Simpler package management with pip requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiefdhurst committed Aug 12, 2024
1 parent 278952b commit fb6074b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 37 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ jobs:
python-version: '3.12'
- name: Install Dependencies
run: |
python -m pip install setuptools
python setup.py develop
python -m pip install -r requirements.txt
- name: Generate Distribution
run: |
python -m blog.generate
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:
python-version: '3.12'
- name: Install Dependencies
run: |
python -m pip install setuptools pylint pytest requests-mock coverage
python setup.py develop
python -m pip install -r requirements.txt
- name: Test
run: |
coverage run -m pytest --verbose --junit-xml tests.xml
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ static site.
You will require Python 3. Run the following to install required modules:

```bash
python3 -m pip installl -r requirements.txt
python3 setup.py develop
```

Expand All @@ -20,14 +21,25 @@ python3 -m blog.generate
To run a local Docker instance of Nginx to serve a generated set of files, run:

```bash
docker run --rm --name blog -v $(pwd)/docker/nginx.conf:/etc/nginx/nginx.conf:ro -v $(pwd)/dist:/usr/share/nginx/html -p 8080:80 nginx
docker run --rm -d --name blog -v $(pwd)/docker/nginx.conf:/etc/nginx/nginx.conf:ro -v $(pwd)/dist:/usr/share/nginx/html -p 8080:80 nginx
```

You can then run the when-changed package to automatically generate the blog files anytime a change is made:

```bash
when-changed -r -1 articles blog -c python3 -m blog.generate
```

*(You must be using a virtual environment or your
Python bin files must be on your path for this to work.)*

Then head to http://localhost:8080 to view the results.

You can stop the docker container with `docker stop blog`.

## Testing

Testing uses Pytest - run it as follows:
Testing uses Pytest - run it as follows (installing the required modules too):

```bash
pytest --verbose
Expand Down
23 changes: 23 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
astroid==3.2.4
certifi==2024.7.4
charset-normalizer==3.3.2
coverage==7.6.1
dill==0.3.8
idna==3.7
iniconfig==2.0.0
isort==5.13.2
Jinja2==3.1.4
Markdown==3.6
MarkupSafe==2.1.5
mccabe==0.7.0
packaging==24.1
platformdirs==4.2.2
pluggy==1.5.0
pylint==3.2.6
pytest==8.3.2
requests==2.32.3
requests-mock==1.12.1
tomlkit==0.13.0
urllib3==2.2.2
watchdog==4.0.2
when-changed==0.3.0
15 changes: 0 additions & 15 deletions setup.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions setup.py

This file was deleted.

0 comments on commit fb6074b

Please sign in to comment.