diff --git a/Dockerfile b/Dockerfile index ba671f7..6bc73d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,9 @@ RUN mkdir /opt/packet WORKDIR /opt/packet -COPY requirements.txt requirements-freeze.txt /opt/packet/ +COPY requirements.txt /opt/packet/ -RUN pip install -r requirements.txt -r requirements-freeze.txt +RUN pip install -r requirements.txt COPY . /opt/packet diff --git a/README.md b/README.md index fb398ba..d7f1742 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ reliable method. ### Python dependencies Use `pip3 install -r requirements.txt` to install the required python dependencies. A [venv](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments) is *highly* -recommended. +recommended. To add new dependencies, add them to `requirements.in` and run `pip-compile requirements.in` to update +the main file. If 1 or more of the packages fail to install the likely issue is missing header files for the libraries with native C components. See the contents of `Dockerfile` for the Linux packages that you'll need. On windows it's a bit more of a diff --git a/package.json b/package.json index 7417a14..0550e4f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "CSH Packet", "name": "csh-packet", - "version": "3.5.5-1", + "version": "3.5.6", "description": "A web app implementation of the CSH introductory packet.", "bugs": { "url": "https://github.com/ComputerScienceHouse/packet/issues", diff --git a/packet/ldap.py b/packet/ldap.py index f276484..a7008a0 100644 --- a/packet/ldap.py +++ b/packet/ldap.py @@ -128,7 +128,7 @@ def get_eboard(self) -> list[CSHMember]: ) + self._get_group_members('eboard-financial') + self._get_group_members('eboard-history' ) + self._get_group_members('eboard-imps') + self._get_group_members('eboard-opcomm' ) + self._get_group_members('eboard-research') + self._get_group_members('eboard-social' - ) + ) + self._get_group_members('eboard-pr') return members @@ -218,6 +218,8 @@ def get_eboard_role(self, member: CSHMember) -> Optional[str]: return_val = 'R&D' elif self._is_member_of_group(member, 'eboard-social'): return_val = 'Social' + elif self._is_member_of_group(member, 'eboard-pr'): + return_val = 'PR' elif self._is_member_of_group(member, 'eboard-secretary'): return_val = 'Secretary' diff --git a/requirements-freeze.txt b/requirements-freeze.txt deleted file mode 100644 index 7970044..0000000 --- a/requirements-freeze.txt +++ /dev/null @@ -1,64 +0,0 @@ -# Please don't edit this file manually. -# You can regenerate it with `pip freeze > requirements-freeze.txt` -alembic==1.7.7 -astroid==2.6.6 -attrs==21.4.0 -Beaker==1.11.0 -blinker==1.4 -certifi==2021.10.8 -cffi==1.15.0 -charset-normalizer==2.0.12 -click==7.1.2 -cryptography==36.0.2 -csh-ldap==2.3.1 -ddtrace==0.57.3 -defusedxml==0.7.1 -dnspython==2.2.1 -Flask==1.1.4 -Flask-gzip==0.2 -Flask-Mail==0.9.1 -Flask-Migrate==2.7.0 -Flask-pyoidc==3.7.0 -Flask-SQLAlchemy==2.5.1 -future==0.18.2 -greenlet==1.1.2 -gunicorn==20.0.4 -idna==3.3 -importlib-resources==5.4.0 -isort==5.10.1 -itsdangerous==1.1.0 -Jinja2==2.11.3 -lazy-object-proxy==1.7.1 -Mako==1.2.0 -MarkupSafe==2.0.1 -mccabe==0.6.1 -mypy==0.931 -mypy-extensions==0.4.3 -oic==1.3.0 -onesignal-sdk==1.0.0 -packaging==21.3 -protobuf==3.19.4 -psycopg2-binary==2.8.6 -pyasn1==0.4.8 -pyasn1-modules==0.2.8 -pycparser==2.21 -pycryptodomex==3.14.1 -pyjwkest==1.4.2 -pylint==2.7.4 -pylint-quotes==0.2.1 -pyparsing==3.0.7 -python-ldap==3.0.0 -requests==2.27.1 -sentry-sdk==1.0.0 -six==1.16.0 -SQLAlchemy==1.4.32 -sqlalchemy2-stubs==0.0.2a20 -srvlookup==2.0.0 -tenacity==8.0.1 -toml==0.10.2 -tomli==2.0.1 -typing_extensions==4.1.1 -urllib3==1.26.9 -Werkzeug==1.0.1 -wrapt==1.12.1 -zipp==3.7.0 diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..c0ccec2 --- /dev/null +++ b/requirements.in @@ -0,0 +1,21 @@ +Flask-Gzip==0.2 +Flask-Mail==0.9.1 +Flask-Migrate~=2.7.0 +Flask-pyoidc~=3.7.0 +Flask~=1.1.4 +csh_ldap~=2.3.1 +ddtrace==1.1.4 +flask_sqlalchemy~=2.5.1 +gunicorn~=20.0.4 +mypy==0.931 +onesignal-sdk~=1.0.0 +psycopg2-binary~=2.9.3 +pylint-quotes==0.2.1 +pylint~=2.7.4 +sentry-sdk~=1.5.12 +sqlalchemy[mypy]~=1.4.31 + +# Broken transitive dependency we should version +MarkupSafe~=2.0.1 +# Tool to generate requirements.txt +pip-tools~=6.6.2 diff --git a/requirements.txt b/requirements.txt index fa66737..baff1f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,19 +1,184 @@ -Flask-Gzip==0.2 -Flask-Mail==0.9.1 -Flask-Migrate~=2.7.0 -Flask-pyoidc~=3.7.0 -Flask~=1.1.4 -csh_ldap~=2.3.1 -ddtrace==0.57.3 -flask_sqlalchemy~=2.5.1 -gunicorn~=20.0.4 +# +# This file is autogenerated by pip-compile with python 3.9 +# To update, run: +# +# pip-compile requirements.in +# +alembic==1.7.7 + # via flask-migrate +astroid==2.6.6 + # via pylint +attrs==21.4.0 + # via ddtrace +beaker==1.11.0 + # via oic +blinker==1.4 + # via flask-mail +certifi==2022.5.18.1 + # via + # requests + # sentry-sdk +cffi==1.15.0 + # via cryptography +charset-normalizer==2.0.12 + # via requests +click==7.1.2 + # via + # flask + # pip-tools +cryptography==37.0.2 + # via oic +csh-ldap==2.3.1 + # via -r requirements.in +ddsketch==2.0.3 + # via ddtrace +ddtrace==1.1.4 + # via -r requirements.in +defusedxml==0.7.1 + # via oic +dnspython==2.2.1 + # via srvlookup +flask==1.1.4 + # via + # -r requirements.in + # flask-gzip + # flask-mail + # flask-migrate + # flask-pyoidc + # flask-sqlalchemy +flask-gzip==0.2 + # via -r requirements.in +flask-mail==0.9.1 + # via -r requirements.in +flask-migrate==2.7.0 + # via -r requirements.in +flask-pyoidc==3.7.0 + # via -r requirements.in +flask-sqlalchemy==2.5.1 + # via + # -r requirements.in + # flask-migrate +future==0.18.2 + # via pyjwkest +gunicorn==20.0.4 + # via -r requirements.in +idna==3.3 + # via requests +importlib-resources==5.7.1 + # via flask-pyoidc +isort==5.10.1 + # via pylint +itsdangerous==1.1.0 + # via flask +jinja2==2.11.3 + # via flask +lazy-object-proxy==1.7.1 + # via astroid +mako==1.2.0 + # via + # alembic + # oic +markupsafe==2.0.1 + # via + # -r requirements.in + # jinja2 + # mako +mccabe==0.6.1 + # via pylint mypy==0.931 -onesignal-sdk~=1.0.0 -psycopg2-binary~=2.8.6 + # via + # -r requirements.in + # sqlalchemy +mypy-extensions==0.4.3 + # via mypy +oic==1.4.0 + # via flask-pyoidc +onesignal-sdk==1.0.0 + # via -r requirements.in +packaging==21.3 + # via ddtrace +pep517==0.12.0 + # via pip-tools +pip-tools==6.6.2 + # via -r requirements.in +protobuf==3.20.1 + # via + # ddsketch + # ddtrace +psycopg2-binary==2.9.3 + # via -r requirements.in +pyasn1==0.4.8 + # via + # pyasn1-modules + # python-ldap +pyasn1-modules==0.2.8 + # via python-ldap +pycparser==2.21 + # via cffi +pycryptodomex==3.14.1 + # via + # oic + # pyjwkest +pyjwkest==1.4.2 + # via oic +pylint==2.7.4 + # via + # -r requirements.in + # pylint-quotes pylint-quotes==0.2.1 -pylint~=2.7.4 -sentry-sdk~=1.0.0 -sqlalchemy[mypy]~=1.4.31 + # via -r requirements.in +pyparsing==3.0.9 + # via packaging +python-ldap==3.0.0 + # via csh-ldap +requests==2.27.1 + # via + # flask-pyoidc + # oic + # onesignal-sdk + # pyjwkest +sentry-sdk==1.5.12 + # via -r requirements.in +six==1.16.0 + # via + # ddsketch + # ddtrace + # pyjwkest +sqlalchemy[mypy]==1.4.36 + # via + # -r requirements.in + # alembic + # flask-sqlalchemy +sqlalchemy2-stubs==0.0.2a22 + # via sqlalchemy +srvlookup==2.0.0 + # via csh-ldap +tenacity==8.0.1 + # via ddtrace +toml==0.10.2 + # via pylint +tomli==2.0.1 + # via + # mypy + # pep517 +typing-extensions==4.2.0 + # via + # mypy + # oic + # sqlalchemy2-stubs +urllib3==1.26.9 + # via + # requests + # sentry-sdk +werkzeug==1.0.1 + # via flask +wheel==0.37.1 + # via pip-tools +wrapt==1.12.1 + # via astroid +zipp==3.8.0 + # via importlib-resources -# Broken transitive dependency we should version -MarkupSafe~=2.0.1 +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools