Skip to content

Commit 3f182a7

Browse files
authored
Merge pull request #48 from FullStackWithLawrence/next
chore: fix path to python requirements
2 parents 026f65e + db71300 commit 3f182a7

5 files changed

Lines changed: 9 additions & 71 deletions

File tree

.github/actions/tests/python/action.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,10 @@ inputs:
1111
description: "The version of Python to use, such as 3.11.0"
1212
required: true
1313
type: string
14-
openai-api-organization:
15-
description: "The OpenAI API organization"
16-
required: true
17-
type: string
18-
openai-api-key:
19-
description: "The OpenAI API key"
20-
required: true
21-
type: string
22-
pinecone-api-key:
23-
description: "The Pinecone API key"
24-
required: true
25-
type: string
26-
pinecone-environment:
27-
description: "The Pinecone environment"
28-
required: true
29-
type: string
30-
pinecone-index-name:
31-
description: "The Pinecone index name"
32-
required: true
33-
type: string
14+
3415

3516
env:
36-
REQUIREMENTS_PATH: "api/terraform/python/layer_genai/requirements.txt"
17+
REQUIREMENTS_PATH: "requirements/local.txt"
3718

3819
runs:
3920
using: "composite"
@@ -46,7 +27,7 @@ runs:
4627
uses: actions/cache@v3
4728
with:
4829
path: ~/.cache/pip
49-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
30+
key: ${{ runner.os }}-pip-${{ hashFiles('**/local.txt') }}
5031
restore-keys: |
5132
${{ runner.os }}-pip
5233
@@ -68,25 +49,15 @@ runs:
6849
- name: Install dependencies
6950
shell: bash
7051
run: |
71-
pip install -r ./requirements.txt
52+
pip install -r ./requirements/local.txt
7253
env:
7354
SITE_PACKAGES_PATH: ${{ env.SITE_PACKAGES_PATH }}
7455

7556
- name: Create .env
7657
shell: bash
7758
run: |
7859
touch ./.env
79-
echo "OPENAI_API_ORGANIZATION=${{ env.OPENAI_API_ORGANIZATION }}" >> ./.env
80-
echo "OPENAI_API_KEY=${{ env.OPENAI_API_KEY }}" >> ./.env
81-
echo "PINECONE_API_KEY=${{ env.PINECONE_API_KEY }}" >> ./.env
82-
echo "PINECONE_ENVIRONMENT=${{ env.PINECONE_ENVIRONMENT }}" >> ./.env
83-
echo "PINECONE_INDEX_NAME=${{ env.PINECONE_INDEX_NAME }}" >> ./.env
8460
env:
85-
OPENAI_API_ORGANIZATION: ${{ inputs.openai-api-organization }}
86-
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
87-
PINECONE_API_KEY: ${{ inputs.pinecone-api-key }}
88-
PINECONE_ENVIRONMENT: ${{ inputs.pinecone-environment }}
89-
PINECONE_INDEX_NAME: ${{ inputs.pinecone-index-name }}
9061

9162
- name: Run Tests
9263
shell: bash

.github/workflows/precommitVersionBumps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
uses: actions/cache@v3
4545
with:
4646
path: ~/.cache/pip
47-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
47+
key: ${{ runner.os }}-pip-${{ hashFiles('**local.txt') }}
4848
restore-keys: |
4949
${{ runner.os }}-pip
5050
@@ -66,7 +66,7 @@ jobs:
6666
- name: Install dependencies
6767
shell: bash
6868
run: |
69-
pip install -r ./requirements.txt
69+
pip install -r ./local.txt
7070
env:
7171
SITE_PACKAGES_PATH: ${{ env.SITE_PACKAGES_PATH }}
7272

.github/workflows/pullRequestController.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ on:
4545
types: [opened, synchronize]
4646
paths:
4747
- "**.py"
48-
- "**.requirements.txt"
48+
- "**.local.txt"
4949
- "**.package.json"
5050
- "./secure_logger/**"
5151

@@ -107,7 +107,7 @@ jobs:
107107
id: file_changes
108108
run: |
109109
echo "::set-output name=files_changed::$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '\.py$' || true)"
110-
echo "::set-output name=requirements_changed::$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'requirements.txt$' || true)"
110+
echo "::set-output name=requirements_changed::$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'local.txt$' || true)"
111111
112112
- name: Run Python tests
113113
if: steps.file_changes.outputs.files_changed != '' || steps.file_changes.outputs.requirements_changed != ''

.github/workflows/runTests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,3 @@ jobs:
2222
uses: ./.github/actions/tests/python
2323
with:
2424
python-version: "${{ env.python-version}}"
25-
openai-api-organization: "${{ secrets.OPENAI_API_ORGANIZATION }}"
26-
openai-api-key: "${{ secrets.OPENAI_API_KEY }}"
27-
pinecone-api-key: "${{ secrets.PINECONE_API_KEY }}"
28-
pinecone-environment: "${{ secrets.PINECONE_ENVIRONMENT }}"
29-
pinecone-index-name: "${{ secrets.PINECONE_INDEX_NAME }}"

README.md

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Tests](https://github.com/FullStackWithLawrence/secure-logger/actions/workflows/tests.yml/badge.svg)](https://github.com/FullStackWithLawrence/secure-logger/actions)
66
![GHA pushMain Status](https://img.shields.io/github/actions/workflow/status/FullStackWithLawrence/secure-logger/pushMain.yml?branch=main)
77
[![Source
8-
code](https://img.shields.io/static/v1?logo=github&label=Git&style=flat-square&color=brightgreen&message=Source%20code)](https://github.com/FullStackWithLawrence/secure-logger)
8+
code](https://img.shields.io/static/v1?logo=github&label=Git&style=flat-square&color=orange&message=Source%20code)](https://github.com/FullStackWithLawrence/secure-logger)
99
[![Release Notes](https://img.shields.io/github/release/FullStackWithLawrence/secure-logger)](https://github.com/FullStackWithLawrence/secure-logger/releases)
1010
[![PyPI
1111
releases](https://img.shields.io/pypi/v/secure-logger?logo=python&logoColor=white)](https://pypi.org/project/secure-logger)
@@ -135,31 +135,3 @@ DEFAULT_SENSITIVE_KEYS = [
135135

136136
Pull requests are welcome, and you can also contact [Lawrence
137137
McDaniel](https://lawrencemcdaniel.com/contact) directly.
138-
139-
### Getting Started With Local development
140-
141-
- Use the same virtual environment that you use for edx-platform
142-
- Ensure that your Python interpreter to 3.11
143-
- install black: <https://pypi.org/project/black/>
144-
- install flake8: <https://flake8.pycqa.org/en/latest/>
145-
- install flake8-coding: <https://pypi.org/project/flake8-coding/>
146-
147-
``` bash
148-
# Run these from within your edx-platform virtual environment
149-
python3 -m venv venv
150-
source venv/bin/activate
151-
152-
pip install -r requirements/local.txt
153-
pip install pre-commit black flake8
154-
pre-commit install
155-
```
156-
157-
#### Local development good practices
158-
159-
- run `black` on modified code before committing.
160-
- run
161-
`flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics`
162-
- run
163-
`flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics`
164-
- run `pre-commit run --all-files` before pushing. see:
165-
<https://pre-commit.com/>

0 commit comments

Comments
 (0)