Skip to content

Commit

Permalink
add eventyay-paypal to docker auto deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
odkhang authored and lcduong committed Sep 24, 2024
1 parent c640291 commit f2c6833
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ dependencies = [
'paypalrestsdk==1.13.3',
'sepaxml==2.6.*',
'geoip2==4.*',
# Note: To install eventyay-stripe/Paypal dependencies, replace {your_token} with your GitHub token
# Access is required to the private repositories, if you don't have access, you can remove the dependencies
'eventyay-stripe @ git+https://[email protected]/fossasia/eventyay-tickets-stripe.git@master',
'eventyay-paypal @ git+https://[email protected]/fossasia/eventyay-tickets-paypal.git@master',
'sendgrid==6.11.*',
'importlib_metadata==7.*',
'qrcode==7.4.*',
Expand Down
16 changes: 12 additions & 4 deletions src/set_github_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,24 @@
# Load the pyproject.toml file
pyproject = toml.load('/pretix/pyproject.toml')

# If github_token is None, remove the eventyay-stripe dependency
# If github_token is None, remove the eventyay-stripe and eventyay-paypal dependency
if not github_token:
pyproject['project']['dependencies'] = [dep for dep in pyproject['project']['dependencies'] if not dep.startswith('eventyay-stripe')]
pyproject['project']['dependencies'] = [
dep for dep in pyproject['project']['dependencies']
if not (dep.startswith('eventyay-stripe') or dep.startswith('eventyay-paypal'))
]
else:
# Iterate over the dependencies
for i, dep in enumerate(pyproject['project']['dependencies']):
if dep.startswith('eventyay-stripe'):
# Update the stripe dependency with the stripe_key
pyproject['project']['dependencies'][i] = f'eventyay-stripe @ git+https://{github_token}@github.com/fossasia/eventyay-tickets-stripe.git@master'
break
# Update the stripe dependency with the github_token
pyproject['project']['dependencies'][
i] = f'eventyay-stripe @ git+https://{github_token}@github.com/fossasia/eventyay-tickets-stripe.git@master'
elif dep.startswith('eventyay-paypal'):
# Update the PayPal dependency with the github_token
pyproject['project']['dependencies'][
i] = f'eventyay-paypal @ git+https://{github_token}@github.com/fossasia/eventyay-tickets-paypal.git@master'

# Write the updated pyproject.toml back to file
with open('/pretix/pyproject.toml', 'w') as f:
Expand Down

0 comments on commit f2c6833

Please sign in to comment.