Skip to content

Commit

Permalink
feat: Add script to generate pensiev package configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
arkohut committed Feb 4, 2025
1 parent 7c82ab5 commit 445299e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 76 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ jobs:
node-version: '20'
- name: Install dependencies
run: |
pip install build
pip install build tomli tomli-w
- name: Build web assets
run: |
cd web
npm install
npm run build
- name: Build Python packages
run: |
# Build original memos package
python -m build
# Create and build pensiev package
python create_pensiev_toml.py
cp pyproject_pensiev.toml pyproject.toml
python -m build --outdir dist_pensiev
# Restore original pyproject.toml
git checkout pyproject.toml
- uses: actions/upload-artifact@v4
with:
name: dist
Expand Down
18 changes: 18 additions & 0 deletions create_pensiev_toml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import tomli
import tomli_w

def create_pensiev_toml():
# Read the original toml file
with open('pyproject.toml', 'rb') as f:
data = tomli.load(f)

# Modify the project name and script name
data['project']['name'] = 'pensiev'
data['project']['scripts'] = {'pen': 'memos.commands:app'}

# Write the modified data to the new file
with open('pyproject_pensiev.toml', 'wb') as f:
tomli_w.dump(data, f)

if __name__ == '__main__':
create_pensiev_toml()
75 changes: 0 additions & 75 deletions pyproject_pensiev.toml

This file was deleted.

0 comments on commit 445299e

Please sign in to comment.