Skip to content

Commit

Permalink
Merge pull request #3939 from mathesar-foundation/0.2.0-testing.1
Browse files Browse the repository at this point in the history
Release 0.2.0-testing.1
  • Loading branch information
mathemancer authored Oct 15, 2024
2 parents f32ca32 + b1c28c9 commit 85a57f4
Show file tree
Hide file tree
Showing 1,036 changed files with 44,246 additions and 26,458 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
ALLOWED_HOSTS='.localhost, 127.0.0.1, [::1]'
SECRET_KEY=2gr6ud88x=(p855_5nbj_+7^bw-iz&n7ldqv%94mjaecl+b9=4
## Uncomment the setting below to put Mathesar in 'demo mode'
# DJANGO_SETTINGS_MODULE=demo.settings
59 changes: 0 additions & 59 deletions .github/workflows/run-e2e-integ-tests.yml.disabled

This file was deleted.

58 changes: 20 additions & 38 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,26 @@ Before getting started with your code changes, read our [Contributor guide](./CO
## Loading sample data
For sample table data, you can create a new table in the UI using the `patents.csv` file found in `/mathesar/tests/data`.
- Using a CSV File (limited visibility of features):
For sample table data, you can create a new table in the UI using the `patents.csv` file found in `/mathesar/tests/data`.
- Using Mathesar Data Playground (recommended):
1. Clone the `mathesar-data-playground` repo:
```
git clone https://github.com/mathesar-foundation/mathesar-data-playground.git
```
2. Load the data from sql by running:
```
sudo docker exec -i mathesar_dev_db bash -c 'psql -U mathesar' < /path/to/your/cloned/repo/mathesar-data-playground/realistic_library_simulation/simulation_runs/simulation_run_20230106_00.sql
```
```
sudo docker exec -i mathesar_dev_db bash -c 'psql -U mathesar' < /path/to/your/cloned/repo/mathesar-data-playground/realistic_library_simulation/simulation_runs/simulation_run_20230106_00_checkouts.sql
```
3. [Sync]( https://docs.mathesar.org/user-guide/syncing-db/) these changes from the UI.
<!-- TODO add more content about sample data -->
Expand Down Expand Up @@ -216,12 +235,6 @@ If you'd like to manually push or pull translations, follow the instructions in
1. Commit and push the changes to our repo.
## Demo mode
Mathesar can be run in "demo mode" to meet the specific needs of our [live demo site](https://demo.mathesar.org).
See our [Live demo mode](./demo/README.md) guide for more information on enabling live demo mode locally
## Opening a shell in the container
Expand All @@ -236,37 +249,6 @@ See our [Live demo mode](./demo/README.md) guide for more information on enablin
```
docker exec -it mathesar_dev_db psql -U mathesar
```
## Building Debian package
- On a Debian machine, install the following dependencies
```
sudo apt install debhelper-compat dh-virtualenv libsystemd-dev libpq-dev libicu-dev pkg-config lsb-release python3-dev python3 python3-setuptools python3-pip python3-venv tar
```
- Setup Mathesar build environment.
This step is useful only when testing locally is needed for building static files and for collecting them. We won't have a need for this step while using the build service as it will be using the source code from release assets which will contain these static files
- Install Python and Nodejs preferably on a Linux machine
- Run the following commands to set up the environment
```
python3 -m venv ./mathesar-venv
source ./mathesar-venv/bin/activate
pip install -r requirements.txt
sudo npm install -g npm-force-resolutions
cd mathesar_ui && npm install --unsafe-perm && npm run build
cd ..
python manage.py collectstatic
```
- From the mathesar directory, run the build script to generate the debian package
```
cd release-scripts && source build-debian.sh
```
## Troubleshooting
Expand Down
21 changes: 2 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ EXPOSE 8000 3000 6006
ENTRYPOINT ["./dev-run.sh"]


#=========== STAGE: COMMON ===================================================#
#=========== STAGE: PRODUCTION ===============================================#

from base as common
from base as production

# Install prod requirements
RUN pip install --no-cache-dir -r requirements-prod.txt
Expand All @@ -105,23 +105,6 @@ RUN rm -rf ./mathesar_ui
RUN rm -rf ./mathesar/tests ./db/tests
RUN rm -rf ./docs


#=========== STAGE: DEMO =====================================================#

FROM common AS demo

# Install prod requirements
RUN pip install --no-cache-dir -r requirements-demo.txt

EXPOSE 8000

ENTRYPOINT ["./run.sh"]


#=========== STAGE: PRODUCTION ===============================================#

FROM common AS production

EXPOSE 8000

ENTRYPOINT ["./run.sh"]
141 changes: 0 additions & 141 deletions Dockerfile.integ-tests

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

3 changes: 0 additions & 3 deletions config/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ def frontend_settings(request):
frontend_settings = {
'development_mode': development_mode,
'manifest_data': manifest_data,
'live_demo_mode': getattr(settings, 'MATHESAR_LIVE_DEMO', False),
'live_demo_username': getattr(settings, 'MATHESAR_LIVE_DEMO_USERNAME', None),
'live_demo_password': getattr(settings, 'MATHESAR_LIVE_DEMO_PASSWORD', None),
'display_language': display_language,
'include_i18n_fallback': display_language != fallback_language,
}
Expand Down
37 changes: 23 additions & 14 deletions config/settings/common_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def pipe_delim(pipe_string):
"rest_framework",
"django_filters",
"django_property_filter",
"drf_spectacular",
"modernrpc",
"mathesar",
]
Expand All @@ -66,7 +65,27 @@ def pipe_delim(pipe_string):
ROOT_URLCONF = "config.urls"

MODERNRPC_METHODS_MODULES = [
'mathesar.rpc.connections'
'mathesar.rpc.collaborators',
'mathesar.rpc.columns',
'mathesar.rpc.columns.metadata',
'mathesar.rpc.connections',
'mathesar.rpc.constraints',
'mathesar.rpc.data_modeling',
'mathesar.rpc.databases',
'mathesar.rpc.databases.configured',
'mathesar.rpc.databases.privileges',
'mathesar.rpc.databases.setup',
'mathesar.rpc.explorations',
'mathesar.rpc.records',
'mathesar.rpc.roles',
'mathesar.rpc.roles.configured',
'mathesar.rpc.schemas',
'mathesar.rpc.schemas.privileges',
'mathesar.rpc.servers.configured',
'mathesar.rpc.tables',
'mathesar.rpc.tables.metadata',
'mathesar.rpc.tables.privileges',
'mathesar.rpc.types',
]

TEMPLATES = [
Expand Down Expand Up @@ -207,18 +226,6 @@ def pipe_delim(pipe_string):
'TEST_REQUEST_DEFAULT_FORMAT': 'json',
'EXCEPTION_HANDLER':
'mathesar.exception_handlers.mathesar_exception_handler',
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema'
}
SPECTACULAR_SETTINGS = {
'TITLE': 'Mathesar API',
'DESCRIPTION': '',
'VERSION': '1.0.0',
'SERVE_INCLUDE_SCHEMA': False,
'PREPROCESSING_HOOKS': ['config.settings.openapi.custom_preprocessing_hook'],
'POSTPROCESSING_HOOKS': [
'config.settings.openapi.remove_url_prefix_hook',
],
# OTHER SETTINGS
}
FRIENDLY_ERRORS = {
'FIELD_ERRORS': {
Expand Down Expand Up @@ -257,6 +264,8 @@ def pipe_delim(pipe_string):
MATHESAR_CAPTURE_UNHANDLED_EXCEPTION = decouple_config('CAPTURE_UNHANDLED_EXCEPTION', default=False)
MATHESAR_STATIC_NON_CODE_FILES_LOCATION = os.path.join(BASE_DIR, 'mathesar/static/non-code/')

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

# UI source files have to be served by Django in order for static assets to be included during dev mode
# https://vitejs.dev/guide/assets.html
# https://vitejs.dev/guide/backend-integration.html
Expand Down
Loading

0 comments on commit 85a57f4

Please sign in to comment.